How to load the image into one or more axes at the same time?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Walter Roberson
le 6 Fév 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!