How to make my code read the input values in appdesigner?
古いコメントを表示
Hi all
I am making an application that should get some input values from UI. But then should run some mfiles that need to know those values. What should I do ? make those variables global ? how ?
9 件のコメント
Mehmet Ziya KESKIN
2020 年 3 月 18 日
Call the function(mfiles) from the callback of the UI element. Something like;
funToCall(uin1,uin2)
There is a lot of ways to do it I suggest you search for it!
farzad
2020 年 3 月 18 日
Mehmet Ziya KESKIN
2020 年 3 月 18 日
If the your script is non-related to your app, I dont think global would work. Instead use
getappdata/setappdata
or
assignin
to base. Using a function is always better I think, and would solve your problems easily.
farzad
2020 年 3 月 18 日
Mehmet Ziya KESKIN
2020 年 3 月 18 日
Global would work. Define global in opening function, define it in pushbutton callbacks, as well. Then set the values.
See this;
Mehmet Ziya KESKIN
2020 年 3 月 18 日
Try starting with the basics, may be a tutorial. There exist syntax error in your code like
% app.ChooseDirectory.value
app.ChooseDirectory.Value
You can't set a directory(string) to a value etc. Try sth like this, I havent tested;
function ChooseDirectoryButtonPushed(app, event)
global currentFolder;
currentFolder = uigetdir;
function StartButtonPushed(app, event)
global currentFolder;
assignin('base','currentFolder',currentFolder);
goFolder = strcat(currentFolder,'\filename.m');
run(goFolder);
I am not really familiar with app designer, you may find more resources if you work with GUIDE.
farzad
2020 年 3 月 18 日
farzad
2020 年 3 月 18 日
回答 (0 件)
カテゴリ
ヘルプ センター および 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!