how to create structure that persists over multiple runs of the same code
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Mike Wilson
am 13 Jun. 2017
Kommentiert: Mike Wilson
am 14 Jun. 2017
I'm looking for a clean way store a structure of variables that persist over multiple runs of the same code.
I use GUIDE to create UIs for processing and plotting geophysical data from full planet scale down to local study areas. Data is both satellite swaths and model output (full coverage). Users often do multiple runs / re-plots in one session. They select a bunch of options in the UI and press a "Run" button to start that process. After inspecting the first plot, most frequently they make a few UI changes and run again, and again, and ...
For each of those re-runs, only a small portion of the many control variables are changed. Those get changed and properly stored by the UI callbacks as the user clicks to make the changes. Unless I do something which seems like poor programming, all the other control parameters from the previous run are lost and have to be retrieved.
The (poor programming) solution I've found is to store those control parameters in the "handles" structure where all the UI components are located. That works fine as that structure persists between runs. But it seems messy to store operation specific control variables in the same place where all the UI elements are located.
I could write all those control variables to a file that gets updated with each run and read that file back in every time the Run button is pushed. Also could re-query all the UI elements every time the Run button is pushed. Both approaches seem really inefficient and error prone.
Is there some simple way to have a structure persist between multiple executions of a Run command in the same manner that the UI Handles structure does?
Thanks!
Mike
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Source Control Integration finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!