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
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 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!