Using the enter key to input multiple values for one variable
Show older comments
I am having some difficulty in obtaining a solution to change this previous code that I had splitting the multiple values with commas:
Acceldata=input('What are your accel values?( Separated by commas and from 0 deg to 270 deg)','s')
outA=regexp(Acceldata,',','split');
outAccel=outA(1:end);
I would like to modify this code, so after the user inputs their first value then hit the enter key, and then the input(Acceldata) appears again then they can enter their second value, hit the enter key and so on. I would then like the output of the input to be the values on different lines after being entered and stored.
Any suggestions or resolutions to apply?
2 Comments
Stephen23
on 15 Jul 2020
You will need to use a loop. What do you want the user to enter to exit this cycle?
Alexandra Philip
on 15 Jul 2020
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing 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!