Run .m script from GUI
11 ビュー (過去 30 日間)
古いコメントを表示
I have a GUI that takes user defined inputs, and I want the user to be able to press a pushbutton on the GUI that then runs the .m script using the variables.
So i have, for the push button:
% --- Executes Setup Balance on button press
function pb_balance_Callback(hObject, eventdata, handles)
% hObject handle to pb_balance (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
run BalanceSetup
Where the button is called pb_balance and the .m script is called BalanceSetup. Will this work or do i need a different command to run it? The .m file is 500 lines long so i don't want to include it in my .m file for the GUI.
Thanks
0 件のコメント
採用された回答
Matt Fig
2012 年 9 月 11 日
You don't need to type run. Just the name of the script will cause the script to execute.
9 件のコメント
Walter Roberson
2014 年 1 月 15 日
Is that not the same thing you are discussing in http://www.mathworks.co.uk/matlabcentral/answers/112219-how-to-use-an-external-script-app-to-automatically-start-the-matlab-model-without-the-user-having-to ?
Tadgh
2014 年 1 月 16 日
Yes but I can't get it to work using what is discussed in that thread. I was hoping if somebody else had another idea on how to get it to work.
Thanks
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Function Creation についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!