Matrix manipulations Re: [Maxima] Size of a matrix
Subject: Matrix manipulations Re: [Maxima] Size of a matrix
From: Stavros Macrakis
Date: Thu, 29 Jan 2004 11:59:47 -0500
> Maxima lacks some useful functions that operate on matrices.
> Another two of them are _deleting_ rows and columns.
> ...Does this mean that a) maxima users never delete rows/cols,
> they only add cols/rows, or b) these functions are
> present but are undocumented, or c) writing these functions
> should be a primer finger-excersise for any maxima beginner?
The functions are present and documented.
- Function: SUBMATRIX (m1, ..., M, n1, ...)
creates a new matrix composed of the matrix M with rows mi
deleted, and columns ni deleted.
- Function: MINOR (M, i, j)
computes the i,j minor of the matrix M. That is, M with row i and
column j removed.
They are also easy finger exercises for beginners (no error-checking for
simplicity):
removerow(m,r):=
genmatrix(
lambda([i,j],
m[ if i>=r then i+1 else i, j ]),
length(m)-1,
length(m[1]));
removecol(m,c):=
genmatrix(
lambda([i,j],
m[ i, if j>=c then j+1 else j ]),
length(m),
length(m[1])-1);