How can I save a gui window with input data ?

2 views (last 30 days)
Omid Rezapour
Omid Rezapour on 30 Sep 2019
Commented: Ankit on 30 Sep 2019
Hello
I made a gui window for calculating some parameters (photo in attachment). When I run the gui program, I insert the inputs in yellow edit boxes and push the "Calculate Outputs" button, then the outputs are shown in green static boxes. My Problem is that when I close this gui window and open (run) it in the next time, the inputs are gone (reset) and I should insert them again. Is there any way to keep (save) the input numbers in the yellow boxes for the next time ?
Thank you
Photo.png
  1 Comment
Ankit
Ankit on 30 Sep 2019
Yes! you can add may be following menu to your GUI
  • Initialize (Initalize with some default values)
  • Save GUI state (saving GUI data as *.mat file) (for e.g saving VehicleMass = app.xxx.Value etc)
  • Load GUI state (loading the desired GUI state) - loading *.mat fle and using "evalin" function read the values

Sign in to comment.

Answers (0)

Categories

Find more on Scope Variables and Generate Names in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!