File: matfun.mac

package info (click to toggle)
maxima 5.47.0-9
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 193,104 kB
  • sloc: lisp: 434,678; fortran: 14,665; tcl: 10,990; sh: 4,577; makefile: 2,763; ansic: 447; java: 328; python: 262; perl: 201; xml: 60; awk: 28; sed: 15; javascript: 2
file content (8 lines) | stat: -rw-r--r-- 324 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8

/* Assorted matrix functions written for ELIZC by JPG */
/* Examples: Let M be a 4x4 matrix.
ROWS(M,[1,3]); gives MATRIX([M11,M12,M13,M14],[M31,M32,M33,M34]).
COLS(M,[1,3]); gives MATRIX([M11,M13],[M21,M23],[M31,M33],[M41,M43]). */

rows(m,r):=apply('matrix,makelist(m[i],i,r))$
cols(m,c):=transpose(rows(transpose(m),c))$