Running a code with preset values or asking for values

1 visualización (últimos 30 días)
Calin Pastean
Calin Pastean el 24 de Abr. de 2015
Editada: Joseph Cheng el 24 de Abr. de 2015
I am writing a code which has some variables at the beginning. I would like the user to have two options when the code is ran: click (or select through another way) a default mode (so the program then runs automatically with pre-set values) and a specified values mode (the program asks for values for some of the variables).
Is there any easy way of doing this? (not using any extra packages)

Respuesta aceptada

Joseph Cheng
Joseph Cheng el 24 de Abr. de 2015
Editada: Joseph Cheng el 24 de Abr. de 2015
You can use the two functions questdlg() and inputdlg() to ask the questions and for them to input the values. The examples in the documentation should be enough describe the usages.

Más respuestas (0)

Categorías

Más información sobre Dialog Boxes en Help Center y File Exchange.

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by