MATLAB: Creating a user interface without GUIDE

actxcontroluicontrol

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

Best Answer

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