How to modify a variable with a gui?
21 views (last 30 days)
Hi, I'd like to create a matlab gui, in which through a button,I can change the value of a variable defined in the workspace. The problem is that i don't know how to pass the variable to the callback function, linked with the button.Thank you
Ramnarayan Krishnamurthy on 28 Dec 2017
In the callback function for the button, use the assignin function to modify the value in the base workspace.
modified_value = 100;
where ' var' is the variable to be modified (assuming you know which variable in the base workspace has to be modified)