MATLAB: Error : “Assignment has more non-singleton rhs dimensions than non-singleton subscripts”

fingerprintminutiae orientation

I am getting this error: can you help me please
Assignment has more non-singleton rhs dimensions than non-singleton subscripts at
OrientationEnd(ind,1) = Table(i,j);
% Finding Orientation ...
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];
% Ridge Ending Orientation ...
for ind = 1:length(CentroidEndX)
Klocal = K(CentroidEndY(ind)-2:CentroidEndY(ind)+2,CentroidEndX(ind)-2:CentroidEndX(ind)+2);
Klocal(2:end-1,2:end-1) = 0;
[i,j] = find(Klocal);
OrientationEnd(ind,1) = Table(i,j);
end
Table is a 5X5 matrix

Best Answer

If you want to use only the first element, you can use the code below. This might still result in an error if no valid positions are found by find.
% Finding Orientation ...
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];
% Ridge Ending Orientation ...
for ind = 1:length(CentroidEndX)
Klocal = K(CentroidEndY(ind)-2:CentroidEndY(ind)+2,CentroidEndX(ind)-2:CentroidEndX(ind)+2);
Klocal(2:end-1,2:end-1) = 0;
[i,j] = find(Klocal);
OrientationEnd(ind,1) = Table(i(1),j(1));
end