edit button in matlab
24 次查看(过去 30 天)
显示 更早的评论
please i need help in making the edit button show on the axes. I parse the text into the button and I am trying to code it. this is my code below. I am new to this site :)
thanks...
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
a=get(handles.edit1,'String')
set(handles.edit1,'String',a)
2 个评论
采纳的回答
Image Analyst
2013-11-3
You say "I want the text in the text bar to show in the axes when the button is pushed."
I don't know what a text bar is, but I assume you mean your edit text field/box. I also will assume you have an axes called axes1 that has a range of 0-10 in the x direction and 0-10 in the y direction. So, just make your pushbutton4 callback look like this.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get the text in the edit box:
editText = get(handles.edit1,'String')
% Make it show up in the axes at location 2,4:
text(2, 4, editText);
2 个评论
Image Analyst
2013-11-4
If I've solved it for you, then please mark the Answer as Accepted, otherwise let's figure out how to get it working.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 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!