Artifact ff899aec5864bf22f593958d2aceeb7c72ec6e5f1cbb5410e98bd210b71eef95:
- Executable file
r37/lisp/csl/html/r37_0343.html
— part of check-in
[f2fda60abd]
at
2011-09-02 18:13:33
on branch master
— Some historical releases purely for archival purposes
git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/trunk/historical@1375 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 1433) [annotate] [blame] [check-ins using] [more...]
<A NAME=MAT> <TITLE>MAT</TITLE></A> <b><a href=r37_idx.html>INDEX</a></b><p><p> <B>MAT</B> _ _ _ _ _ _ _ _ _ _ _ _ <B>operator</B><P> <P> <P> <P> The <em>mat</em> operator is used to represent a two-dimensional <A HREF=r37_0345.html>matrix</A>. <P> <H3> syntax: </H3> <P> <P> <em>mat</em>((<expr>{,<expr>}*) {(<expr>{<em>,</em><expr >}*)}*) <P> <P> <P> <expr> may be any valid REDUCE scalar expression. <P> <P> <P> <H3> examples: </H3> <P><PRE><TT> mat((1,2),(3,4)); MAT(1,1) := 1 MAT(2,3) := 2 MAT(2,1) := 3 MAT(2,2) := 4 mat(2,1); ***** Matrix mismatch Cont? (Y or N) matrix qt; qt := ws; QT(1,1) := 1 QT(1,2) := 2 QT(2,1) := 3 QT(2,2) := 4 matrix a,b; a := mat((x),(y),(z)); A(1,1) := X A(2,1) := Y A(3,1) := Z b := mat((sin x,cos x,1)); B(1,1) := SIN(X) B(1,2) := COS(X) B(1,3) := 1 </TT></PRE><P>Matrices need not have a size declared (unlike arrays). <em>mat </em> redimensions a matrix variable as needed. It is necessary, of course, that all rows be the same length. An anonymous matrix, as shown in the first example, must be named before it can be referenced (note error message). When using <em>mat</em> to fill a 1 x n matrix, the row of values must be inside a second set of parentheses, to eliminate ambiguity. <P> <P> <P>