MATLAB Answers

how to execute an .m file by clicking push button in an another gui file?

17 ビュー (過去 30 日間)
sarath chandra kumar boga
sarath chandra kumar boga 2015 年 5 月 12 日
Answered: Othmane ELMOUATAMID 2018 年 7 月 18 日
hi, i have created a gui file with a push button. i want to run another matlab file by clicking the push button in gui file. help me regarding this.
thank you.

  0 件のコメント

サインイン to comment.

件の回答 (2)

Image Analyst
Image Analyst 2015 年 5 月 12 日
Just put the name of the second m-file in the callback function of your push button. If the file is a function, rather than a script, you can also pass it input arguments if you want to or need to.

  2 件のコメント

Walter Roberson
Walter Roberson 2015 年 5 月 12 日
At works you might need to use the 'run' command.
Image Analyst
Image Analyst 2015 年 5 月 13 日
Not sure what that means, but I've tried running a script in another script, in a simple function, and in the pushbutton callback of a program written with GUIDE, and in all cases simply putting this on it's own line
secondscript
ran secondscript.m. I did not have to do
run('secondscript.m');

サインイン to comment.


Othmane ELMOUATAMID
Othmane ELMOUATAMID 2018 年 7 月 18 日
This answer works well with me.

  0 件のコメント

サインイン to comment.

サインイン してこの質問に回答します。


Translated by