Data Plot in Matlab -


i have 2 arrays x , y same dimension. can plot each points (x,y) plot(x,y). how can color them according given labels?

say x = [3, 4, 2, 5, 6], y = [2, 2, 1, 5, 6] , label = [1, 2, 2, [1,2], 2]. here have color points label=1 blue , points in label=2 red. how can this?

there several ways optimize code , away without using loop should started

for i=1:length(x)     xdot=x(i)     ydot=y(i)     ldot=label(i)     col=[1 0 0;0 0 1];     plot(xdot,ydot,'color',col(ldot,:),'marker','o');     hold on end 

Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

Swift game error message -