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 中查找有关 Just for fun 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by