Sponsored links: Algebra eBooks

### The Maxima on-line user's manual

Algebra Calculator

#### Read_matrix

Function: read_matrix (<S>)

Function: read_matrix (<S>, <M>)

Function: read_matrix (<S>, <separator_flag>)

Function: read_matrix (<S>, <M>, <separator_flag>) `read_matrix(<S>)` reads the source <S> and returns its entire content as a matrix. The size of the matrix is inferred from the input data; each line of the file becomes one row of the matrix. If some lines have different lengths, `read_matrix` complains.

`read_matrix(<S>, <M>)` read the source <S> into the matrix <M>, until <M> is full or the source is exhausted. Input data are read into the matrix in row-major order; the input need not have the same number of rows and columns as <M>.

The source <S> may be a file name or a stream.

The recognized values of <separator_flag> are `comma`, `pipe`, `semicolon`, and `space`. If <separator_flag> is not specified, the file is assumed space-delimited.

```(%o1)                                true
(%i2) ```

### Related Examples

##### matrix

x:matrix([1, 0, 0], [...

y:matrix([cy, 0, -sy]...

z:matrix([cz, sz, 0],...

Calculate

##### matrix

I4 : matrix([1,0,0,0]...

C: matrix([1,-1,0,0],...

C2 : C.C;

Calculate

##### matrix-transpose

f(x,y,z):=[x+y+z,x+y-...

mf:transpose(matrix(f...

m2:matrix(f(1,0,0),f(...

Calculate

##### matrix-triangularize

M: matrix ([1, 0, 0, ...

triangularize (M);

Calculate

##### matrix-modulus

modulus:5;

p:matrix([[a,b],[c,d]]);

middle:matrix([[2,0],...

Calculate

##### matrix-transpose

A : matrix([a,b],[a+d...

At : transpose(A);

C : matrix([c],[c+d]);

Calculate

##### matrix

R=matrix([1,0,0,-1,0,...

Dip=matrix([0,-d,-d,-...

R^-1*Dip*R;

Calculate

##### matrix

c: matrix([a,b],[c,d]);

Calculate

##### matrix-transpose

a: matrix ([1, 1, 1],...

inverse(a.transpose(a));

Calculate

##### matrix

K : matrix( [1.000,...

W : matrix( [0.316,...

Q : matrix( [0.000,...

Calculate