for i=1:3 for j=1:3 mat_cor= InsideSquareCoordinate2{i,j}; mat_data=InsideSquareGrade2{i,j}; mat_data=mat_data(mat_data~=0); mat_dl=length(mat_data); %%%%%%%%%%%****-----------------------------------------------------------------------------------------****%
% mat_data(:,n1)
% n1=1;
% if ~isempty (InsideSquareCoordinate2{i,j})
VarIsg=0; tempPointCord=InsideSquareCoordinate2{i,j}; xCordInside=tempPointCord(:,1); yCordInside=tempPointCord(:,2); for i1=1:mat_dl for j1=1:mat_dl if (i1~=j1) d=sqrt((xCordInside(i1)-xCordInside(j1))^2 + (yCordInside(i1)-yCordInside(j1))^2); if((xCordInside(j1)-yCordInside(i1))==0) theta=90; else theta=180.*atan((yCordInside(j1)-yCordInside(i1))./(xCordInside(j1)-yCordInside(i1)))./pi; end minlag=10; nlag=3; laginv=10; clear('ISG') for k=1:nlag llag(k)=minlag+(k-1)*laginv; hlag(k)=llag(k)+laginv; b=abs(d.*sin(theta-azm)); if((llag(k)<=d && d<hlag(k))&&(lowangle<=theta &&theta<upangle)&&(b<=maxbandw)) ISG(k)= sum((mat_data(i1)- mat_data(j1)).^2)/(2*mat_dl); end end ISG VarIsg{i,j}=ISG end end end % ISG
% VarIsg{i,j}=0;
end end
MATLAB: WHY EVERY TIME I AM GETTING THE ERROR “Cell contents assignment to a non-cell array object.” I need to store the value of “ISG” which is a one dimensional array(array elements changes for every i,j) into every cell of “VarIsg” .. PLEASE HELP ME OUT
cell contents assignment to a non-cell array object
Best Answer