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, 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)

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