when i try to read number of images from a file in to a program using the "cell" matlab is showing error? Pleasing help me with reading number of images from a file into a single program !!

조회 수: 1 (최근 30일)
%n=6
% images=cell(1,n);
% fnamefmt='%d.jpg';
% for i=1:n
% image(i)=imread(sprintf(fnamefmt,i));
% end
% result=cell(1,n);
% for i=1:n
% result(i)=imshow(images(1));
% end
The error it's showing is
%Conversion to cell from double is not possible.
Error in dabb (line 17) c(1)=double(imread('1.jpg'));

채택된 답변

sixwwwwww
sixwwwwww 2013년 10월 14일
편집: sixwwwwww 2013년 10월 17일
Dear Vijay, here is correction in your code:
n = 2;
images = cell(1,n);
for i=1:n
images{i} = imread(strcat('filename', num2str(i), '.png'));
end
for i = 1:n
figure, imshow(images{i});
end
  댓글 수: 3
sixwwwwww
sixwwwwww 2013년 10월 17일
In order to use cell array you need to use curly brackets
{}
not the brackets which are normally used for indexing
()
I hope it explains the difference

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by