vector - Plotting MATLAB values in two different colors -


anyway, wish plot 2 column vectors, filled random numbers no negative values in them, on 2d plot(x , y).

the 'x-vector' can leave is, 'y vector', wish plot y values equal 0 different color(say red) other positive non-zero values(say blue).

please try keep solution relatively simple, if possible, myself relatively new matlab site.

i'm not sure mean 2d plot assuming mean normal curve. try this:

x = rand(10, 1); y = rand(10, 1);  y([5 8]) = 0; %force couple of values 0 visualisation  t = 1:10;      plot(t, x); hold on plot(t, y, 'g'); ind = y == 0; %make logical index masks value y not 0 plot(t(ind), y(ind), 'r*'); 

enter image description here


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -