2 digit input to a loop
Show older comments
I have a script where the user should input to numbers and after that I want to make a loop between these numbers. However if I input a 2 digit number it doesn't work for some reason.
Here is my code:
ModeNumber=input('First mode ','s');
ModeLast=input('Last mode ','s');
for mLoop = ModeNumber:ModeLast
I tried making the input a number by removing the 's' and I also tried using str2num in the mLoop, but this doesn't work as well.
Thanks
Accepted Answer
More Answers (0)
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!