필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

sir i have made a gui in which a push button gets images from folders of the computeers and i have a edit texts which shows the name of the image and i want to use that image for anothers pushbutton can you suggest me a way?

조회 수: 1 (최근 30일)
[filename]=uigetfile({'*.jpg'},'File Selector');
image=strcat(filename);
axes(handles.axes1);
imshow(image);
set(handles.filename,'string',filename);
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
  댓글 수: 1
Jan
Jan 2015년 6월 1일
편집: Jan 2015년 6월 1일
I've edited your code to improve the readability. Please use the "{} Code" button.
The question is not clear. "Use that image for another pushbutton"?
strcat(filename) does nothing - I assume you need the filepath in addition? See: help uigetfile.

답변 (1개)

Image Analyst
Image Analyst 2015년 6월 1일
Requiring users to type in the name of the file they want is not user friendly. Why don't you just load up a listbox of all the files that they might choose. See MAGIC: http://www.mathworks.com/matlabcentral/fileexchange/24224-magic-matlab-generic-imaging-component
Also read the FAQ to see how you can transfer variables between callback functions: http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.28s.29.3F

이 질문은 마감되었습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by