I have 2 datasets and a line :
for example :
dt1X = [1:30];
dt1Y = [1:30];
dt2X = [1:30];
dt2Y = [0.5:0.5:15.0];
line = [2 1]; % y= 2 + x;
I want to draw these two dataset and line in same graph with different colours.How can I do that?
I tried the line below to change a color but it gave this error : invalid value for array property "cdata"
hold on;
scatter(dt1X,dt1Y,[],"r"); %this line give error
scatter(dt2X,dt2Y,[],"g");
hold off;
EDIT:
hold on;
scatter(dt1X,dt1Y,[],[],"r");
scatter(dt1X,dt1Y,[],[],"g");
hold off;
Result : No error but both datasets draw with blue dots...
using "r" and 'r' Didn't change anythinh it works same in both situation.
") by single quotes ('). Other than that, I get no errors - Luis Mendo[],before the"r". - David