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

- July 20th 2008, 09: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)

- July 20th 2008, 10:34 AMCaptainBlack
- July 20th 2008, 10:47 AMCaptainBlack