Undefined function or variable 'I'
显示 更早的评论
I declared variable 'I' in first function(Open file GUI), like this
function Untitled_4_Callback(hObject, eventdata, handles)
[filename, pathname] = uigetfile( ...
{'*.jpg;*.gif;*.bmp*.png;*.tif',...
'Pic File (*.jpg,*.gif,*.bmp,*.png,*.tif)';}, ...
'Take pic!');
handles.fullImageFileName = fullfile(pathname, filename);
im_original=imread(handles.fullImageFileName );
I = imread(handles.fullImageFileName);
axes(handles.axes1);
image(im_original);
then i call 'I' in other function :
function uipushtool1_ClickedCallback(hObject, eventdata, handles)
gray = rgb2gray(I);
...etc
and error :
??? Undefined function or variable 'I'.
Error in ==> scoreRead5 at 4
gray = rgb2gray(I);
i have tried to make 'I' as global, but error too. Help me please, Masters
回答(1 个)
类别
在 帮助中心 和 File Exchange 中查找有关 App Building 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!