Matlab loop help

Why doesnt this work?Code:`for x = 1:15`

if x < 5

y = 2*x - 5;

elseif 5 < x <10

y = 4*x;

elseif 10< x <15

y = x*x;

end;

end;

plot(x,y)

Printable View

- Jul 20th 2008, 10:35 AMj-lee00Matlab loop help
**Matlab loop help**

Code:`for x = 1:15`

if x < 5

y = 2*x - 5;

elseif 5 < x <10

y = 4*x;

elseif 10< x <15

y = x*x;

end;

end;

plot(x,y)

- Jul 20th 2008, 11:34 AMCaptainBlack
- Jul 20th 2008, 11:47 AMCaptainBlack