Adding a question based on the replies, is it possible to pass an array to callback function? i am trying the code below, but the array elements are not getting passed into the callback function.
pb1 = uicontrol(f,'Style','pushbutton','String','Slice# in yz plane',...
'Position',[1425 600 100 50],...
'callback',@(src,eventdata,samplemag)pb1_callback);
And the callback function is :
function pb1_callback(src,eventdata,samplemag)
But the data from 'samplemag' is not getting passed into the function. Any help?