MATLAB: Invalid first data argument

plot

The following code:
plot(x,y,'Marker','*','Color','r',x2,y2,'Marker','--','Color','b')
generates this error: "Invalid first data argument".
here x, y and x2, y2 are arrays of same size.

Best Answer

'--' is not a valid choice for 'Marker'. Use a valid marker. See the help for a list of them.
Try this:
plot(x,y,'r*-', x2,y2,'bd-');