Running a code with preset values or asking for values

조회 수: 1 (최근 30일)
Calin Pastean
Calin Pastean 2015년 4월 24일
편집: Joseph Cheng 2015년 4월 24일
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)

채택된 답변

Joseph Cheng
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개)

카테고리

Help CenterFile Exchange에서 Dialog Boxes에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by