How to prompt for input using an existing variable in the prompt.
- by ldigas
I'm trying to ask the user for a value of some variable, but at the same time, showing him the last value used (at the termination of the program, the values are saved to a file, and loaded at the start of the program).
Something like this:
Enter new radius value (R=12.6) :
... user enters 12.7 ...
Enter new pi value (pi=3.14) :
Enter new height value (h=30.0) :
Usually I would write the first one with write statement, then read the new one (in Fortran, for example). In MATLAB however, I don't know how to write something out with input statement. Are there some other statements for getting input ?