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

조회 수: 7 (최근 30일)
Aishwarya  D
Aishwarya D 2014년 4월 22일
댓글: sed banj 2022년 4월 30일
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)

채택된 답변

Chandrasekhar
Chandrasekhar 2014년 4월 22일
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
Othmane ELMOUATAMID
Othmane ELMOUATAMID 2018년 7월 18일
편집: Othmane ELMOUATAMID 2018년 7월 18일
Thank you, it works well.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Swaraj Varma
Swaraj Varma 2017년 4월 22일
file executed but workspace is blank help !!

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by