I am trying to write a graphical interface in MatLab that allows me to output the data that it outputs and move it to the workspace. I am currently achieving this with an assignment function, but what I would like to do is the name of the variable to change depending on what the user enters into the edit box
Here is my current script:
function Save_Callback(hObject, eventdata, handles, vavargin)
a=str2num(get(handles.VariableA,'String'));
b=str2num(get(handles.VariableB,'String'));
c=str2num(get(handles.VariableC,'String'));
d=str2num(get(handles.VariableD,'String'));
regionname=(get(handles.RegionName,'String'));
assignin('base','regionname' ,[a;b;c;d]);
Each time you press the save button, he simply names this region name, and does not capture the text entered by the user.
Does anyone have any ideas? Since I'm fairly new to MatLab, try to make the explanation as simple as possible.
source
share