function [ind1,ind2]=nm2ind(nm1,nm2) %NM2IND - Converts the matrix indexes into coordinates (nm). % % [IND1,IND2]=NM2IND(NM1,NM2) % % NMs are the vectors of the x-y indexes espressed in nm; % INDs are the vector of the x-y matrixes indexes. % % See also IND2NM % % Claudio Apr 15, 1995 % % % Copyright (c) 1995 by Claudio Rivetti and Mark Young % claudio@alice.uoregon.edu, mark@alice.uoregon.edu % global I H ss=scansize(H); xoff = xoffset(H); yoff = yoffset(H); px=size(I,1); ind1=ceil((nm1-xoff)*px/ss); ind2=ceil((nm2-yoff)*px/ss); return