Change Variable Value in a Script through App Designer GUI

조회 수: 12 (최근 30일)
Nick M.
Nick M. 2019년 3월 6일
편집: Stephen23 2019년 3월 12일
Hi, I have a GUI made with App Designer where depending on the option selected from a drop down menu, a particular script will run when a button called 'START' is pressed. I also have several 'Edit Field (Numeric)' where I would want to edit the value of a variable from the GUI. So my issue is how do I change the variable value that is assigned in the script through the GUI's Edit Field.
m.JPG
function STARTButtonPushed(app, event)
if (strcmp(app.SelectTechniqueDropDown.Value,'Option1')
run('script1.m')
elseif (strcmp(app.SelectTechniqueDropDown.Value,'Option2')
run('script2.m')
elseif (strcmp(app.SelectTechniqueDropDown.Value, 'Option3')
run('script3.m')
end
  댓글 수: 9
Nick M.
Nick M. 2019년 3월 12일
Its either a 4x4 matrix in this form for example:
[1 0 0 0;
0 1 0 0;
0 0 1 0;
0 0 0 1]
or a 4x1 matrix in this form for example:
[1;1;1;0]
Stephen23
Stephen23 2019년 3월 12일
편집: Stephen23 2019년 3월 12일
"...how to allow a user to input a matrix into an edit field?"
Rather than using an edit field, it would be simpler to use a uitable:

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by