MATLAB reference - M ATLAB array manipulation tips and...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: M ATLAB array manipulation tips and tricks Peter J. Acklam E-mail: pjacklam@online.no URL: http://home.online.no/~pjacklam 14th August 2002 Abstract This document is intended to be a compilation of tips and tricks mainly related to efficient ways of performing low-level array manipulation in M ATLAB . Here, manipu- lation means replicating and rotating arrays or parts of arrays, inserting, extracting, permuting and shifting elements, generating combinations and permutations of ele- ments, run-length encoding and decoding, multiplying and dividing arrays and calcu- lating distance matrics and so forth. A few other issues regarding how to write fast M ATLAB code are also covered. Id like to thank the following people (in alphabetical order) for their suggestions, spotting typos and other contributions they have made. Ken Doniger and Dr. Denis Gilbert Copyright 20002002 Peter J. Acklam. All rights reserved. Any material in this document may be reproduced or duplicated for personal or educational use. M ATLAB is a trademark of The MathWorks, Inc. ( http://www.mathworks.com ). T E X is a trademark of the American Mathematical Society ( http://www.ams.org ). Adobe PostScript and Adobe Acrobat Reader are trademarks of Adobe Systems Incorporated ( http://www.adobe.com ). The T E X source was written with the GNU Emacs text editor. The GNU Emacs home page is http://www.gnu.org/software/emacs/emacs.html . The T E X source was formatted with A M S-L A T E X to produce a DVI (device independent) file. The PS (PostScript) version was created from the DVI file with dvips by Tomas Rokicki. The PDF (Portable Document Format) version was created from the PS file with ps2pdf , a part of Aladdin Ghostscript by Aladdin Enterprises. The PS and PDF version may be viewed and printed with software available at the Ghostscript, Ghostview and GSview Home Page, http://www.cs.wisc.edu/~ghost/index.html . The PDF version may also be viewed and printed with Adobe Acrobat Reader, which is available at http://www.adobe.com/products/acrobat/readstep.html . CONTENTS 2 Contents 1 Introduction 4 1.1 The motivation for writing this document . . . . . . . . . . . . . . . . . . . . . . . 4 1.2 Who this document is for . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.3 Credit where credit is due . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.4 Errors and feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.5 Vectorization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2 Operators, functions and special characters 6 2.1 Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.2 Built-in functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.3 M-file functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3 Basic array properties 8 3.1 Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .....
View Full Document

This note was uploaded on 01/14/2011 for the course MATH 571 taught by Professor Staff during the Winter '08 term at University of Michigan.

Page1 / 46

MATLAB reference - M ATLAB array manipulation tips and...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online