Undefined function or variable 'I'
Ältere Kommentare anzeigen
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
Antworten (1)
Kategorien
Mehr zu App Building finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!