Running a code with preset values or asking for values
3 次查看(过去 30 天)
显示 更早的评论
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)
0 个评论
采纳的回答
Joseph Cheng
2015-4-24
编辑:Joseph Cheng
2015-4-24
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.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!