GUI. Handle variable.
显示 更早的评论
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]);
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Creating, Deleting, and Querying Graphics Objects 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!