Creating a user interface without GUIDE

I am trying to create a sort of user interface without the use of GUIDE. I need to include start and stop buttons for my data collection (with DataQ). The following is a glimpse of the code I am have difficulties with: ... uicontrol('Style', 'pushbutton','String', 'Start',... 'Position', [20 390 50 20],... 'Callback', {@starting}); uicontrol('Style', 'pushbutton','String', 'Stop',... 'Position', [70 390 50 20],... 'Callback', {@stopping}); end
function starting(dataqsdk1)
%Start Acquiring Data dataqsdk1.Start; dataqsdk1.GetData;
I am having difficulties creating the callback function to begin and stop data collection. At the moment, based on the above code, I am getting the following error:
??? Error using ==> DataqSDK>starting Too many input arguments.
??? Error while evaluating uicontrol Callback

 채택된 답변

Paulo Silva
Paulo Silva 2011년 7월 4일

1 개 추천

you are missing arguments, try like this
'Callback', {@starting,dataqsdk1}
and
function starting(obj,ev,dataqsdk1)
same goes for the other functions you may have

댓글 수: 3

Mel
Mel 2011년 7월 4일
Would you happen to know how I can add a scrollbar (or slider) to the x axis of my graph (generated viaactxcontrol)?
Jan
Jan 2011년 7월 4일
@Mel: Remember, that the callback "@funcname" needs the function header: "function funcname(ObjH, EventData)". See "Creating and Executing Callback functions" in the documentation.
Jan
Jan 2011년 7월 4일
@Mel: Please open a new thread for a new question.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

질문:

Mel
2011년 7월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by