MATLAB Answers

How to execute .m file by pressing Push button in the created GUI?

35 views (last 30 days)
I have tried using run(.m). but it's not working.
function pushbutton2_Callback(hObject, eventdata, handles) % hObject handle to pushbutton2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) run(tikhnovphh1)

  0 Comments

Sign in to comment.

Accepted Answer

Chandrasekhar
Chandrasekhar on 22 Apr 2014
write only the file name instead of run(tikhnovphh1).
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
tikhnovphh1; %m file to be executed.

  3 Comments

HASHEM RAMADAN
HASHEM RAMADAN on 3 Apr 2018
Its working but after pressing in the push button the figure will close immediately. any solution for this problem ?

Sign in to comment.

More Answers (1)

Community Treasure Hunt

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

Start Hunting!