matlab plot different colors -


i have set of points (matrix nx1) , groups points (matrix nx1). want plot points (there no problem, this: plot(points, groups, 'o');), i'd set unique color each group. how can this? have 2 groups (1,2).

use logical indexing select points want

figure; hold all; % keep old plots , cycle through colors  ind = (groups == 1); % select points groups 1  % can kind of logical selections here: % ind = (groups < 5)  plot(points(ind), groups(ind), 'o'); 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -