开发者

MATLAB: Adding simple GUI to existing complete program

I have spent the last few months working on a program in MATLAB. As of now, 1.0 is complete. The program is pretty much autonomous, but requires a few users inputs. I am trying to add a simple GUI interface to enter these paramaters and check off/on 开发者_开发百科options. I know that MATLAB has a GUI format for new files, but I want to know if it is possible to add the GUI to a preexisting program.

Here is what I need the program to have:

a. a few check boxes that change values in the program from 'false' to 'true and vice-versa.

b. a few short fields that allow user entry

c. a start button that runs the program and plots graphs.

How Would you suggest I go about this?

Thank you so much,

-Alex


You need to refactor your program so that it exposes its main functionality as MATLAB functions that can be called from other places.

Some of these functions would perform the main computations taking as input the parameters you mention. Other functions would be dedicated to plotting the result.

Once you do that, designing a GUI to drive the program is as simple as calling the correct functions from the callback routines of the GUI components.


Start guide put all the buttons and fields you need (graphically) and bind the button to your functions.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜