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)

 Respuesta aceptada

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 comentarios

Aishwarya  D
Aishwarya D el 22 de Abr. de 2014
Editada: Aishwarya D el 22 de Abr. de 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 ?
Othmane ELMOUATAMID
Othmane ELMOUATAMID el 18 de Jul. de 2018
Editada: Othmane ELMOUATAMID el 18 de Jul. de 2018
Thank you, it works well.
thank u sur

Iniciar sesión para comentar.

Más respuestas (1)

Categorías

Más información sobre Environment and Settings en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 22 de Abr. de 2014

Comentada:

el 30 de Abr. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by