hi. I have create a figure and want to manually create a button and edit box on it too
%Add push button and edit boxes to analyse specific point
f1=figure;ax1=subplot(1,1,1)pb1 = uicontrol('Style', 'pushbutton',... 'String', {'Go'},... 'Position', [10 70 80 20],... 'Callback', @(src,evt) IntegratedIntensity( src, evt, ax1,handles ));edx = uicontrol('Style', 'edit',... 'String', {'x pixel'},... 'Position', [10 40 40 20]);
I have connected the pushbutton to a function:
function IntegratedIntensity(source,event,ax,handles) x=str2num(get(handles.edx,'String'));
However, when I call this function, the error indicates the edit box isn't recognised.
Reference to non-existent field 'edx'.
Best Answer