See other catalogues for
The MathWorks
You may also be interested in
Text version of the page
| | | | | | | | | | |
| | | |
| | | Creating and Concatenating Matrices | | |
| | | |
| | | D = blkdiag(A, B, C) D = 8 1 6 0 0 0 0 0 35700000 49200000 0 0 0 -5 -6 -9 0 0 0 0 0-4-4-2 0 0 00000080 00000008 Generating a Numeric Sequence Because numeric sequences can often be useful in constructing and indexing into matrices and arrays, MATLAB provides a special operator to assist in creating them. This section covers • "The Colon Operator" on page 1-11 • "Using the Colon Operator with a Step Value" on page 1-12 | | |
| | | |
| | | The Colon Operator The colon operator (first:last) generates a 1-by-n matrix (or vector)of sequential numbers from the first valuetothe last. The default sequence is made up of incremental values, each 1 greater than the previous one: A = 10:15 A= 10 11 12 13 14 15 The numeric sequence does not have to be made up of positive integers. It can include negative numbers and fractional numbers as well: A = -2.5:2.5 A= -2.5000 -1.5000 -0.5000 0.5000 1.5000 2.5000 By default, MATLAB always increments by exactly 1 when creating the sequence, even ifthe ending value is not an integral distance from the start: | | |
| | | |
| | | 1-11 | | |
| | | |
| | | | | | | | | | |