Creating a control window
Show older comments
Currently I have uigetfile called twice used in conjunction with load to load 2 data files. This is compiled into an executable which plots the data.
Would it be possible to have a control window open where these files can be selected and changed, which would cause the data to be replotted? Currently I have to close the exe and re-run it. I would also like there to be buttons (such as yes or no) which when clicked, would modify some variables and re-plot the data.
I imagine this will get much more complicated with GUI programming compared to my more simple program now which just uses matlab functions and runs through it. I guess my main question is what is required to jump to the beginning of the code and make the changes initiated by the control panel?
Accepted Answer
More Answers (1)
Walter Roberson
on 17 Oct 2011
0 votes
There are only a couple of real changes:
- you do not destroy the file selection and parameter control windows once the files are selected and parameters for the run are decided
- Instead, when the user clicks asking to process with those parameters, you either hide the selection and control windows (by setting their 'visible' property 'off') or set their button 'enable' properties to be 'off'. This will prevent the user from giving conflicting instructions while something is being processed
- when processing the individual run is finished, either set the windows to be visible again or re-enable their action buttons.
There will be no need to "jump" to the beginning of code: the fact that the GUI is present and enabled will allow the user to re-trigger running the analysis routines.
Categories
Find more on App Building 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!