Updating workspace variables using GUIDE

2 次查看(过去 30 天)
I am trying to create a GUI using 'GUIDE' and have a set of workspace variables that I would like the GUI to update. I have 25 variables that I would like the user to update once they press an update button. Ideally, they would open the GUI, enter in 25 user inputs into separate 'edit text' boxes , followed by a click of the update button and then that should update the workspace variables.
I hope you can help!
  12 个评论
Craig Saunders
Craig Saunders 2018-7-27
Thanks Adam! I'll give this a try - ideally I would like to use GUIDE though as I can make the user interface customisable fairly quickly.
I understand GUIDE creates an auto-generated code which then needs to be updated with how the buttons and 'edit text' fields function. It would be great to see an example code which allows a user to enter a value into the 'Edit Text' field, hit the button, which will then trigger a change in the workspace variable. At present I have been able to enter a value within GUI.m which changes the workspace variable, however I want this value entered into the 'User Input' field of the GUI instead.
Cheers.
Rik
Rik 2018-7-27
I would suggest not using GUIDE in the first place (even for GUI design), but rather read the doc for uicontrol. The values you enter are stored in the String property of each edit field. The callback for the button needs to convert them to numeric values and put them in a struct output.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

产品


版本

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by