I am using matlab's 'find' function below. I get an error saying "Subscripted assignment dimension mismatch," because there are some empty sets in the find solution. I know that 'find' will return an error if it cannot find a solution, but is there a way around this? I simply want a way to use 'find' (or something equivalent) that will not give an error when no sol is found but will instead give an empty set. A simplified version of my code is below where N is a layered 824x824x3 matrix and FGIF is a 936x2 matrix.
[FGIF_r, FGIF_c] = size(FGIF);
tol = 0.00005;
for i = 1:FGIF_r
[row(i), col(i)] = find(abs(N_new(:,:,2) - FGIF(i,1)) <= tol & abs(N_new(:,:,3) - FGIF(i,2)) <= tol);