Variable is not fully defined on some execution paths.

조회 수: 16 (최근 30일)
Poornima Asuti
Poornima Asuti 2019년 7월 17일
댓글: Poornima Asuti 2019년 7월 18일
I have written a matlab code for dividing an image into smaller parts. While using the HDL coder, I am getting an error "Variable 'tcell2{1, 1}' is not fully defined on some execution paths".
%%croping the image and storing the values in a cell
t=1;
tcell2=cell(10,10);
for y=0:100:900
s=1;
for z=0:100:900
final=imcrop(pic2,[(z+1) (y+1) width height]);
tcell2{t,s}=final;
s=s+1;
end
t=t+1;
end
%%taking mean of the elements in a matrix and storing values in a cell
for i=1:1:10
for l=1:1:10
mtcell2{i,l}=mean2(tcell2{i,l});%% getting an error over here
end
end
  댓글 수: 2
KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 7월 17일
편집: KALYAN ACHARJYA 2019년 7월 17일
%%croping the image and storing the values in a cell and mean of each cell element
If this is the objective, then you can do it by more simpler way.
Poornima Asuti
Poornima Asuti 2019년 7월 18일
Can you please elaborate how?

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

채택된 답변

Jan
Jan 2019년 7월 17일
편집: Jan 2019년 7월 17일
Does this help?
tcell2 = cell(10,10);
for t = 1:10
for s = 1:10
tcell2{t,s} = imcrop(pic2, ...
[(t-1)*100 + 1, (s-1)*100 + 1, width, height]);
end
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Denoising and Compression에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by