Hi everybody, I'm developing a GUI and I need to load a variable into the workspace. I'm using the "assignin" function but it generates a struct variable. This is my code:
function popupmenu1_callback(hObject, eventdata, handles)
asset = 'XYZ';
assignin('base',asset, load('XYZ.mat'));
end
the output is XYZ struct variable. Thus, to get my data I must do XYZ.XYZ . How can avoid that and to get directly the XYZ variable (not like a struct)? Many thanks!
1 Comment
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/369467-how-to-load-a-variable-into-the-workspace-not-as-a-structure-into-a-gui#comment_509516
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/369467-how-to-load-a-variable-into-the-workspace-not-as-a-structure-into-a-gui#comment_509516
Sign in to comment.