Continuously updating Edit Field in Designer GUI

4 views (last 30 days)
Hi,
I am trying to create a gui with edit field and graphs that will keep updating values from the matlab 'base' workspace until I stop it. However, I do not see any methods to do it. We can use the evalin to get value of a variable from workspace into GUI but I dont see anyway to updating it.
For example i want to passing the value of the variable i into the gui. I can use the following callback function for a push button.
app.EditField_7.Value = evalin('base','i');
but is there anyway to continously to updating the value into the gui rather than pressing the push button? I have try the state button and put the command the loop but it did not work.
Also any solution to plotting the graphs in real time using continous updating variable from the workspace?
Thank you very much,

Answers (1)

Walter Roberson
Walter Roberson on 31 Aug 2022
You can create a timer object that continually gets new values from the base workspace and does whatever is appropriate with them.
However, it is not clear to me why you would do that, instead of having whatever process is changing the variables in the base workspace make the change to the properties.
  1 Comment
Long Nguyen
Long Nguyen on 1 Sep 2022
Edited: Long Nguyen on 1 Sep 2022
Hi Walter,
Thanks for your comment. Can you please help me with an example for the timer object that continually gets new values from the base workspace and updating the value in the edit filed in GUI?
For the reason, let's take an example that I create a matlab program and GUI using matlab designer. Now, I can interact with the matlab program using the GUI to send new values to a variable in matlab workspace. However, I do not know how can I continously update the values from the workspace into the GUI, I only can update it through a push button with evalin funtions, which does not work if I want to run the program continously and show the results in the GUI.
Agian, thank you very much for your time. I really appreciate your help and your answer.

Sign in to comment.

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!