GUI. Handle variable.
Show older comments
Hi. Is this the right way to retrieve a variable from handle? I read the documentation and examples but still didn't manage to make it work. Pls, give me a hint whats wrong. Learning to use guide I'm trying to draw a line between 2 points inputted in the textbox.
Thanks.
function x1_Callback(hObject, eventdata, handles)
handles.X1=str2double(get(handles.x1,'string'));
guidata(hObject,handles);
function y1_Callback(hObject, eventdata, handles)
handles.Y1=str2double(get(handles.y1,'string'));
guidata(hObject,handles);
function x2_Callback(hObject, eventdata, handles)
handles.X2=str2double(get(handles.x2,'string'));
guidata(hObject,handles);
function y2_Callback(hObject, eventdata, handles)
handles.Y2=str2double(get(handles.y2,'string'));
guidata(hObject,handles);
function startDisplay_Callback(hObject, eventdata, handles)
handles.X1=xOne;
handles.Y1=yOne;
handles.X2=xTwo;
handles.Y2=yTwo;
plot([xOne, xTwo],[yOne,yTwo]);
Accepted Answer
More Answers (0)
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!