How to call pushbutton callback again in uicontrol

조회 수: 1 (최근 30일)
amir nemat
amir nemat 2017년 9월 2일
댓글: Image Analyst 2017년 9월 4일
I want to use pushbutton2_callback again in my code like following
h_record=uicontrol('style','pushbutton', 'pos', [730,30,25,25], 'Callback', @pushbutton2_Callback);
but it gives me an error
Error using tpac6de6f0_2275_443d_a558_3c8bef237e41>pushbutton2_Callback (line 1056) Not enough input arguments.
Error while evaluating uicontrol Callback
  댓글 수: 1
Image Analyst
Image Analyst 2017년 9월 4일
Why not just create the control in GUIDE rather than dynamically with a line of MATLAB code? Then you don't have the problem.

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

답변 (1개)

Joost
Joost 2017년 9월 2일
Uicontrol callbacks have two default input arguments. Please have a look at the example on the following help page: https://nl.mathworks.com/help/matlab/creating_guis/write-callbacks-using-the-programmatic-workflow.html
  댓글 수: 2
amir nemat
amir nemat 2017년 9월 2일
Thanks for your respond. I have tested them but none of them are working for me my pushbutton is pushbutton2_Callback(hObject, eventdata, handles)
and I use Matalb 2014a version
amir nemat
amir nemat 2017년 9월 4일
Thanks for your respond. I have tested them but none of them are working for me my pushbutton is pushbutton2_Callback(hObject, eventdata, handles)
and I use Matalb 2014a version

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

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by