"data( 4 ) = 7" continuing from the above example. A matrix referenced with a single subscript is treated as if it were "unwound" column by column into a vector form.X = data( 3, 3 ) % Error - element doesn't exist.ĭata( 3, 3 ) = 42 % Sets the value and expands the array, filling with zeros. ) For example:ĭata = ones( 2, 2 ) % Creates a 2 x 2 array of value 1 Trying to READ an element of an array that is out of bounds will generate an error, but WRITING to one will simply expand the array to accommodate the new data ( so long as the indices are positive.^ - Acts on matrices element by element, as opposed to normal matrix operations. Left division is only relevant to matrix operations:.May be different for scalars versus arrays versus combinations of both.Matlab Course Notes - Basic Matrix Operations
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |