Call an attribute from a Matlab script in AppDesigner GUI
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File 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!