Call an attribute from a Matlab script in AppDesigner GUI

조회 수: 3 (최근 30일)
Lucas S
Lucas S 2019년 5월 9일
편집: Lucas S 2019년 5월 9일
I have created a GUI with app designer which launch a matlab program after the user chose a file and pressed launch button :
function LaunchButtonPushed(app, event)
app.ResultWindowTextArea.BackgroundColor = 'green';
app.ResultWindowTextArea.FontSize = 20;
app.ResultWindowTextArea.Value = 'Launch of the program ...';
testLectureXML(app.FileTextArea.Value{:});
if n_component == 0
app.ResultWindowTextArea.BackgroundColor = 'red';
app.ResultWindowTextArea.Value = 'Please choose a valid File !';
stop testLectureXML()
end
end
n_component is an attribute in my testLectureXML matlab program and he is equal to 0 only if the file that the user chose is empty. But it's like my application doesn't recognize n_component as the attribute of my testLectureXML program.
And if possible, if n_component = 0 i would like to stop the program
How can i do this ? Thanks !
Edit : To stop the programm i have thinking of creating
exitProgram = 0 and if exitProgram = 1 return 0
and in the GUI code i just put exitProgram = 1 if the file is empty but i don't know how to access to an attribute of a matlab script with GUI code.

답변 (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