
Originally Posted by
CaptainBlack
That depend on what you expect it to do. x and y are scalars when you get to the plot command, what do you want them to be?
RonL
One interpretaion of what you are trying to do would be:
Code:
x = 1:15;
y=zeros(1,15);
y=y+(x<=5).*(-y+2*x-5);
y=y+((5<x)&(x<=10)).*(-y+4*x);
y=y+((10<x)&(x<=15)).*(-y+x.*x);
plot(x,y)
RonL