function z=edm(w,p) % A=edm(w,p) % Input: w, number of points by dimension % Input: p is number of points by dimension % Ouput: Matrix z, number points in w by number pts in p % which is the distance from one point to another %Check dimensions to make sure data was input properly: [S,R] = size(w); [Q,R2] = size(p); p=p'; if (R ~= R2) error('Inner matrix dimensions do not match.'); end z = zeros(S,Q); %Allocate space for the EDM if (Q