필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

cell array to array conversion

조회 수: 1 (최근 30일)
Maruthi Maruthi
Maruthi Maruthi 2017년 10월 10일
마감: MATLAB Answer Bot 2021년 8월 20일
Sir,
I'm getting the above error and the code is shown below. Please help me my project.
for i=2:n
gray2{i}=rgb2gray(im_cropped{i});
d2{i}=im2double(gray2{i});
c=d2{i};
targets(:,i)=c(:);
i=i+1;
end
Subscripted assignment dimension mismatch.
Error in image_net (line 28)
targets(:,i)=c(:);
Error in Imageclickback (line 20)
image_net(im_cropped,a,a2,a3,a4);
Error in img_net (line 23)
Imageclickback(a,a2,a3,a4,n);

답변 (1개)

Walter Roberson
Walter Roberson 2017년 10월 10일
Your im_cropped are not all the same size as each other. Or possibly they are, but you had previously initialized targets to a different number of rows.
  댓글 수: 1
Image Analyst
Image Analyst 2017년 10월 10일
편집: Image Analyst 2017년 10월 10일
Agreed. I seriously doubt you even need to have two giant cell arrays containing all the images anyway. Why not just get the image and cropped image and process them right then and there? Why save them in cell arrays? I virtually never do that.
Next, setting i=i+1 inside a for loop that is itself setting i is not a good idea. Whatever you set i to will be overwritten once the next iteration begins. Anyway, use k. Most MATLABers don't use i and j for loop iterators since those represent the imaginary variable.

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by