필터 지우기
필터 지우기

Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 40000-by-1. Error in mat (line 73) C(:,s) = g(:);. how to solve this error?

조회 수: 1 (최근 30일)
This is my code
lx=double(Ix);
ly=double(Iy);
lxy=double(Ixy);
lxx=double(Ixx);
lyy=double(Iyy);
g = sqrt(lx.*lx + ly.*ly);
d = sqrt( (lxx-lyy).^2+ 4*lxy.^2 );
figure, imshow(g),title('I1');
figure, imshow(d),title('I2');
s=sigma;
SI = 0.5-1/pi*atan((-lxx-lyy)./sqrt((lxx-lyy).^2+ 4*lxy.^2));
imshow(SI)
SI_label= atan_vq(SI, Ls);
SI_code(:,s) = SI_label(:);
C(:,s) = g(:);
C(:,s + 1*length(F)) = d(:);
G2=C(:,1:3);
D2=C(:,4:6); % d
r=2/pi*atan(Coef*D2./G2);
help me to solve this error.
  댓글 수: 1
Stephen23
Stephen23 2018년 8월 23일
편집: Stephen23 2018년 8월 23일
"help me to solve this error."
Simple: don't try to allocate 40,000 elements into one element.
Using sigma as an index looks quite suspicious to me... but in any case as we do not have the complete code, any values, or any explanation of what the badly aligned code should be doing, we will have to rely on guessing what you are doing. If you want help, please upload an MWE by clicking the paperclip button.

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

답변 (1개)

Shan Sha
Shan Sha 2018년 8월 23일
I am having many doubts in that code! shall i upload my full code

카테고리

Help CenterFile Exchange에서 Performance and Memory에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by