Monday, July 31, 2006

[Matlab]Functions

B = squeeze(A):

Remove the singleton dimension;
Remove the dimensions of size 1;
Remove the redundant dimensions.

B = repmat(A,[m n p...]):

Replicate and tile an array

B = sub2ind(size,sub1, sub2, ...);
B = ind2sub(size, index);

Convert subscripts to index or vice versus

profile on;
...
profile viewer;

Profile execution time for function

No comments: