Simple matlab programming question

MisterPants

Senior member
Apr 28, 2001
335
0
0
I'm trying to change the color of plot lines with the index of a for loop. I have a long if list that like this:
elseif(jm==6)
ls='b';

but I get an error on:
plot(t,y(1,:),'ls-');

whereas I get a blue line from
plot(t,y(1,:),'b-');

How do I fix it?