MATLAB Answers

Hello there!...Any one can help me please how to import and then get file that already preprocessed in matlab format or .mat text file when clicked on push button.

1 view (last 30 days)
Abdisa Amensisa
Abdisa Amensisa on 3 Feb 2018
Answered: Gayatri Menon on 13 Feb 2018
I have a pre-processed text file in .mat format and I want to get the text file when I clicked on push button.

  1 Comment

Abdisa Amensisa
Abdisa Amensisa on 3 Feb 2018
In GUI, I do have a push button. I want that when this push button is pressed a text file which is already pre-processed would be opened automatically without choosing a file.How can I do that....please I need your help.

Sign in to comment.

Answers (1)

Gayatri Menon
Gayatri Menon on 13 Feb 2018
Hi, You could enter the command to load the mat file in the pushbutton callback function.Please note that the workspace of functions which you are using in GUI is different than the Base workspace.So, if you want to load the mat file in base workspace, you will have to specify the workspace.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
evalin('base', 'load(''test.mat'')');
Hope the above code helps in understanding the point I was trying to explain Thanks


Sign in to comment.

Sign in to answer this question.