Diff for "MatlabNotes" - CBU statistics Wiki
location: Diff for "MatlabNotes"
Differences between revisions 6 and 7
Revision 6 as of 2009-03-20 12:00:53
Size: 863
Comment:
Revision 7 as of 2013-03-08 10:18:03
Size: 863
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

Some Jottings Related to MATLAB

Manipulating Arrays

reshape

shiftdim

shiftdim allows one to do generalised tranposition. If A is a matrix then shiftdim(A,1) is equal to A'. In fact the 1 can be any odd number; since transposition is of order 2 an even number will leave A unchanged.

>> A=reshape(1:12,3,4)

A =

     1     4     7    10
     2     5     8    11
     3     6     9    12

>> shiftdim(A,3)

ans =

     1     2     3
     4     5     6
     7     8     9
    10    11    12

>> shiftdim(A,6)

ans =

     1     4     7    10
     2     5     8    11
     3     6     9    12

circshift

http://www-h.eng.cam.ac.uk/help/tpl/programs/Matlab/faster_scripts.html

http://www-h.eng.cam.ac.uk/help/tpl/programs/Matlab/tricks.htm

None: MatlabNotes (last edited 2013-03-08 10:18:03 by localhost)