how i can use the value of a in other function?

조회 수: 1 (최근 30일)
sana saleeme
sana saleeme 2016년 5월 1일
댓글: sana saleeme 2016년 5월 2일
how i can use the value of a in other function? and my code is here.
function pushbutton1_Callback(hObject, eventdata, handles)
[a , b] = uigetfile({'*.*' , 'all files'});
imread(a);
imshow(a);
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
v = imread(a);
bw = im2bw(a);
  댓글 수: 1
sana saleeme
sana saleeme 2016년 5월 1일
i did it by using global.but now no function apply on a like im2bw and rgb2gray not working on it.please guide me what should a i do?

댓글을 달려면 로그인하십시오.

채택된 답변

Jan
Jan 2016년 5월 1일
function pushbutton1_Callback(hObject, eventdata, handles)
[a , b] = uigetfile({'*.*' , 'all files'});
imread(a);
imshow(a);
handles.a = a;
guidata(hObject, handles);
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
handles = guidata(hObject);
v = imread(handles.a);
bw = im2bw(handles.a);
Note: Better use absolute file names with path:
a = fullfile(b, a);

추가 답변 (1개)

Image Analyst
Image Analyst 2016년 5월 1일

카테고리

Help CenterFile Exchange에서 Test and Measurement에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by