How to prompt for input using an existing variable in the prompt.

Posted by ldigas on Stack Overflow See other posts from Stack Overflow or by ldigas
Published on 2010-05-08T12:54:37Z Indexed on 2010/05/11 1:24 UTC
Read the original article Hit count: 218

Filed under:

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 ?

© Stack Overflow or respective owner

Related posts about matlab