Vector and matrix element access: Difference between revisions

From iMath
Jump to navigation Jump to search
(Created page with "Elements of vectors and matrices can be accessed in two ways: With the mindex function and with angular brackets <code>[ ]</code>. * <code>...")
 
No edit summary
 
Line 2: Line 2:
* <code>[ [[expression]] ]</code> accesses an element of a vector.  
* <code>[ [[expression]] ]</code> accesses an element of a vector.  
* <code>[ [[expression]] , [[expression]] ]</code> accesses an element of a matrix. Either of the expressions can be replaced by an asterisk <code>*</code>, then the whole row or column will be returned as a vector.
* <code>[ [[expression]] , [[expression]] ]</code> accesses an element of a matrix. Either of the expressions can be replaced by an asterisk <code>*</code>, then the whole row or column will be returned as a vector.
[[Category:Element]]

Latest revision as of 19:08, 6 July 2017

Elements of vectors and matrices can be accessed in two ways: With the mindex function and with angular brackets [ ].

  • [ expression ] accesses an element of a vector.
  • [ expression , expression ] accesses an element of a matrix. Either of the expressions can be replaced by an asterisk *, then the whole row or column will be returned as a vector.