MATLAB Tips

Distance matrix between two sets of vectors

% X is pxM, Y is pxN, dist is MxN
dist = sqrt(sum(( repmat(permute(X, [2 3 1]), [1 N 1]) ...
       - repmat(permute(Y, [3 2 1]), [M 1 1]) ).^2, 3));

Useful toolboxes

Generic

Specialized

  • cvx: fast prototyping of convex optimization problems
  • SNOPT: good nonlinear optimization software (student edition)
  • LSH: locality sensitive hashing
  • Camera calibration toolbox: one of the standard tools in computer vision

Other resources