I have created a matlab script ("main.m") which with a loop. In each iteration I call a matlab GUI slider to get an input from the user.
Using this input and some calculation a plot is shown. this happens in each iteration and the results depend on all previous inputs.
the script looks like this in general
Now instead of showing the plot in a diffrent window, I though about adding axes to the GUI.
What I want to do is to change the order of operation to:
- the user to only run the "GUI.m" file.
- GUI runs "main.m"
- "main.m" takes the slider input
- "main.m" does all calcluation the same way.
- finally the plot is shown in GUI axes
I couldn't do what I want and I am not sure it by simply running "main.m" in GUI OpeningFcn.
What Other way can accomplish this if possible.