I have designed a pushbutton on a MATLAB figure and written a callback function, while the function runs without any error, it does not produce any output. May I know how to retrieve the output from the callback function. Here is my code :
The screen :
f=figure('Position',[10 100 1500 700]);pb1 = uicontrol(f,'Style','pushbutton','String','Slice# in yz plane',...'Position',[1425 600 100 50],...'callback',@(src,eventdata)pb1_callback(slice_numx));
The callback function :
function[slice_num] = pb1_callback(src,eventdata)prompt={'Enter the Slice Number'};slicenum = inputdlg(prompt);slice_num = str2double(slicenum);
When I press the pusbutton 'pb1', it gives a popup window wherein I input the number. Issue is that I am not able to find this entered number in my main program. I am sure there is some issue with defining it in main program. Any help will be upvoted.
Cheers,
Guru
Best Answer