MATLAB Programming

MATLAB Programming MATLAB Programming

cda.psych.uiuc.edu
from cda.psych.uiuc.edu More from this publisher
23.06.2015 Views

Contents 1 Data Structures Creating and Concatenating Matrices ............... 1-3 Constructing a Simple Matrix ....................... 1-3 Specialized Matrix Functions ........................ 1-5 Concatenating Matrices ............................ 1-7 Matrix Concatenation Functions ..................... 1-8 Generating a Numeric Sequence ..................... 1-10 Combining Unlike Data Types ....................... 1-12 Matrix Indexing ................................... 1-18 Accessing Single Elements .......................... 1-18 Linear Indexing ................................... 1-19 Functions That Control Indexing Style ................ 1-19 Accessing Multiple Elements ........................ 1-20 Logical Indexing .................................. 1-23 Indexing on Assignment ............................ 1-23 Getting Information About a Matrix ................. 1-24 Dimensions of the Matrix ........................... 1-24 Data Types Used in the Matrix ...................... 1-25 Data Structures Used in the Matrix .................. 1-26 Resizing and Reshaping Matrices ................... 1-27 Expanding the Size of a Matrix ...................... 1-27 Diminishing the Size of a Matrix ..................... 1-31 Reshaping a Matrix ................................ 1-32 Preallocating Memory .............................. 1-34 Shifting and Sorting Matrices ...................... 1-37 Shift and Sort Functions ............................ 1-37 Shifting the Location of Matrix Elements .............. 1-37 Sorting the Data in Each Column .................... 1-39 Sorting the Data in Each Row ....................... 1-39 Sorting Row Vectors ............................... 1-40 v

Contents<br />

1<br />

Data Structures<br />

Creating and Concatenating Matrices ............... 1-3<br />

Constructing a Simple Matrix ....................... 1-3<br />

Specialized Matrix Functions ........................ 1-5<br />

Concatenating Matrices ............................ 1-7<br />

Matrix Concatenation Functions ..................... 1-8<br />

Generating a Numeric Sequence ..................... 1-10<br />

Combining Unlike Data Types ....................... 1-12<br />

Matrix Indexing ................................... 1-18<br />

Accessing Single Elements .......................... 1-18<br />

Linear Indexing ................................... 1-19<br />

Functions That Control Indexing Style ................ 1-19<br />

Accessing Multiple Elements ........................ 1-20<br />

Logical Indexing .................................. 1-23<br />

Indexing on Assignment ............................ 1-23<br />

Getting Information About a Matrix ................. 1-24<br />

Dimensions of the Matrix ........................... 1-24<br />

Data Types Used in the Matrix ...................... 1-25<br />

Data Structures Used in the Matrix .................. 1-26<br />

Resizing and Reshaping Matrices ................... 1-27<br />

Expanding the Size of a Matrix ...................... 1-27<br />

Diminishing the Size of a Matrix ..................... 1-31<br />

Reshaping a Matrix ................................ 1-32<br />

Preallocating Memory .............................. 1-34<br />

Shifting and Sorting Matrices ...................... 1-37<br />

Shift and Sort Functions ............................ 1-37<br />

Shifting the Location of Matrix Elements .............. 1-37<br />

Sorting the Data in Each Column .................... 1-39<br />

Sorting the Data in Each Row ....................... 1-39<br />

Sorting Row Vectors ............................... 1-40<br />

v

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!