필터 지우기
필터 지우기

Why do i get this error?

조회 수: 2 (최근 30일)
new user 00
new user 00 2018년 7월 1일
댓글: new user 00 2018년 7월 1일
In a gui, I used a push button with a callbackfunction.
p1 = uicontrol('Style','pushbutton','String','Browse','Position',[480,500,150,50],'callback',{@browse_button_Callback});
"Error:Too many input arguments" I am totally unaware of the mistake.

채택된 답변

Adam Danz
Adam Danz 2018년 7월 1일
편집: Adam Danz 2018년 7월 1일
The first two inputs of a callback function are
  1. The object handle
  2. An event data structure
See this for more info.
If those are your only inputs, remove the curly brackets around your function call.
p1 = uicontrol('Style','pushbutton','String','Browse','Position',[480,500,150,50],'callback',@browse_button_Callback);
Use the curly brackets to pass additional inputs to your callback function. For example
p1 = uicontrol(..., 'callback',{@browse_button_Callback, data});
will pass the 'data' variable as the third input to browse_button_callback().
If you're not passing additional inputs to your callback function, you should only have those first two inputs.
If that doesn't help, please provide the actual callback function.
  댓글 수: 1
new user 00
new user 00 2018년 7월 1일
Thanks!! it did help.

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

추가 답변 (0개)

카테고리

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