I have a certain GUI built without GUIDE, just plain old uicontrols and I've gotten everything to work properly so far. However I want to, upon a button press grab the value in a text-box (edit) and store it into a variable fi.
Basically the code in question;
c2 = uicontrol(f,'Style', 'pushbutton','String','Rotation','Callback',
@rotation);
s1 = uicontrol(f,'Style', 'edit');
function rotation(src,event)
load 'BatMan.mat' X
fi = %This is the value I want to have the value as the edit box.
subplot(2,2,1)
PlotFigure(X)
end
Easiest is to get
rotationto know abouts1through an input argument:Here, we set the callback for
c2to be an anonymous function with the right signature (2 input arguments), and which callsrotationwiths1as an additional argument. The callback now has the handles1embedded in it.