How to load the image into one or more axes at the same time?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have to use following code for load the two different images for different axes. But i got the Error message How to rectify that error?
??? Cell contents reference from a non-cell array object.
Error in ==> colrc>imagebtn_Callback at 84
filename=fullfile(Folder,File{iFile});
Error in ==> gui_mainfcn at 96 feval(varargin{:});
Error in ==> colrc at 42 gui_mainfcn(gui_State, varargin{:});
Error in ==> @(hObject,eventdata)colrc('imagebtn_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback
Code:
function imagebtn_Callback(hObject, eventdata, handles)
% hObject handle to imagebtn (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[File,Folder]=uigetfile('*.*','Multiselect','on');
handles.img=cell(1,length(File));
for iFile=1:length(File)
filename=fullfile(Folder,File{iFile});
image=imread(filename);
axes(handles.axes{iFile});
imshow(image);
handles.img{iFile}=image;
end
guidata(hObject,handles);
Please any one help this problem.
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 6 Feb. 2013
filename=fullfile(Folder,File(iFile).name);
but like I warned you in your earlier question, you are going to have problems unless you have already created the axes you are referencing through handles.axes{iFile}
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating, Deleting, and Querying Graphics Objects finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!