hi, can you help me fix this error "Subscripted assignment dimension mismatch" occured while executing the following function at line 201...using find() function.

execute the trail file, and help in fixing the errors. %% Orientation % Once we determined the differents minutiae, we have to find the % orientation of each one Table=[3*pi/4 2*pi/3 pi/2 pi/3 pi/4 5*pi/6 0 0 0 pi/6 pi 0 0 0 0 -5*pi/6 0 0 0 -pi/6 -3*pi/4 -2*pi/3 -pi/2 -pi/3 -pi/4]; %% Termination Orientation % We have to find the orientation of the termination. % For finding that, we analyze the position of the pixel on the boundary of % a 5 x 5 bounding box of the termination. We compare this position to the % Table variable. The Table variable gives the angle in radian. for ind=1:length(CentroidTermX) Klocal=K(CentroidTermY(ind)-2:CentroidTermY(ind)+2,CentroidTermX(ind)-2:CentroidTermX(ind)+2); Klocal(2:end-1,2:end-1)=0; [i,j]=find(Klocal); OrientationTerm(ind,1)=Table(i,j); end dxTerm=sin(OrientationTerm)*5; dyTerm=cos(OrientationTerm)*5; figure imshow(K) set(gcf,'position',[1 1 600 600]); hold on plot(CentroidTermX,CentroidTermY,'ro','linewidth',2) plot([CentroidTermX CentroidTermX+dyTerm]',... [CentroidTermY CentroidTermY-dxTerm]','r','linewidth',2)
the error shown up is 'Subscripted assignment dimension mismatch'.

Answers (1)

Klocal might have more than one non-zero location. The find() would return multiple values in that case, and you would then try to store those multiple values in the single location OrientationTerm(ind,1)
You might want to use find(Klocal,1)

Categories

Find more on Just for fun in Help Center and File Exchange

Asked:

on 20 Mar 2017

Answered:

on 2 Nov 2020

Community Treasure Hunt

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

Start Hunting!