Any Matlab Users? Or programming experts?

Spoolx

Active Member
Established Member
Joined
Jun 20, 2010
Messages
1,780
Location
Florida
Hi all
I am just learning MATlab and could use some advice

I am trying to use an if statement where 1= something and 2= something else, my concern is say the user inputs a value other than 1 or 2 the if statement ends.

Is there a way to restart the if statement if the user inputs a value greater than 2??

Thanks
 

leo2hot4tv

New Member
Established Member
Joined
Sep 14, 2012
Messages
742
Location
South Florida
Use a loop. It's been a while since I did programming for school, but there are ways to use loops and if you have an "if" statement you should have the "else". Use the "else" to loop back and restart it.
 

Users who are viewing this thread



Top