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

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)

 Akzeptierte Antwort

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.

4 Kommentare

Aishwarya  D
Aishwarya D am 22 Apr. 2014
Bearbeitet: Aishwarya D am 22 Apr. 2014
@ Akshata M It got executed.Thank you.
Its working but after pressing in the push button the figure will close immediately. any solution for this problem ?
Thank you, it works well.
thank u sur

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Swaraj Varma
Swaraj Varma am 22 Apr. 2017

0 Stimmen

file executed but workspace is blank help !!

Kategorien

Mehr zu Environment and Settings finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by