for x = 1:15(adsbygoogle = window.adsbygoogle || []).push({});

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)

Why doesnt this work?

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matlab loop help

Loading...

Similar Threads - Matlab loop help | Date |
---|---|

Matlab Arduino-MATLAB communication using SerialEvent() for PID Loop | Oct 28, 2016 |

Matlab infinite loop help | Feb 18, 2011 |

Matlab help: indexing in for loops | Sep 25, 2010 |

Matlab! HELP! Infinite Loop. | Jun 30, 2010 |

Matlab loop help | May 25, 2010 |

**Physics Forums - The Fusion of Science and Community**