Executing the script file in GUI Callback

Hello, I have to create a GUI where inputs are given into two text boxes and a graph is plotted for the corresponding inputs. Further upon pressing one more push button, I want the GUI to run the program from a script file and then return the output back to the GUI in the form of a table. The script file has a program of about 300 lines and hence I do not want to write the entire program under the callback. I am relatively new to Matlab and have no experience with using GUIDE. If any example GUI is available for reference, then it will be of great help. Thanks in advance.

回答(1 个)

Jan
Jan 2016-3-8
There is not difference between writing the code directly into the callback or to a script file. The script file is processed exactly as it would be inserted in the calling code.
So what exactly is your question? What do you mean by "table"? A uitable, a matrix or a table obejct? Perhaps an Excel-Sheet or file?

1 个评论

Thank you for the response. The output should be displayed in uitable. What if a function file has to be executed in the callback? Actually, I have written a .m script file which now needs a GUI. The steps that are needed are as follows:
1. Input the two variables 'x' and 'y' in the text boxes in the GUI. The input must be saved in the form of a 'm x 2' matrix.
2. Upon pressing a plot button, the input data has to be plotted.
3. Further, on pressing one more push button the calculations has to be made. The calculations can either be run from a script file, a function file or by directly writing the codes in the callback.
4. The output data has to be displayed in the uitable in GUI.
If any such examples/tutorials are availabe then it will be of great help as I've to get this done soon. Thanks in advance.

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by