From the result you got for the button callback, it appears that the callback has been created in the following way (just for example):
hButton = uicontrol(...,'Callback',{@button_callback,1,1,[1:6]});
where the callback function button_callback
is defined as follows:
function button_callback(hObject,eventdata,a,b,c)
...
end
Notice that there are two extra arguments in the input argument list for the callback function: hObject
(the handle of the object invoking the callback) and eventdata
(a structure of event data).
If you want to invoke the function handle with the 3 additional arguments that should be passed to it (1
, 1
, and a 1-by-6 array), you need to also pass arguments for the hObject
and eventdata
inputs. Here's how calling the function would look (using your variable ans
):
ans{1}(hButton,[],ans{2:end});
You first get the function handle from the cell array (ans{1}
) then call it using parentheses as you would any other function. For hObject
you can pass the handle to the uicontrol object (or an empty value if it isn't needed), and for eventdata
you can just pass an empty value. The additional values are then taken from the cell array as a comma-separated list (ans{2:end}
) and each is passed to the function as a separate additional argument.