Sponsored links: Algebra eBooks ### The Maxima on-line user's manual

Algebra Calculator

#### Search:  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

a:matrix([c0,-s0,0],[...

Calculate

##### matrix

a:matrix([k+x-y,k+x,k...

a;

Calculate

##### matrix

a:matrix([6,5],[4,3],...

b:matrix([1,2,3],[4,5...

a.b;

Calculate

##### matrix-reverse

A:(matrix([3,1],[-1,2...

B:reverse(A);

C:-B;

Calculate

##### matrix-submatrix

m:matrix([1,2,3],[4,7...

m2:submatrix(m,3);

Calculate

##### matrix-transpose

T: matrix([0.85,0.01,...

X0: transpose( matrix...

T3: T . T . T;

Calculate

##### matrix

A:matrix([1,2],[2,3]);

A*A;

Calculate

##### matrix

m:matrix([5,2,-1],[9,...

Calculate

##### matrix

x: matrix ([17, 3], [...

y: matrix ([%pi, %e]...

matrixsize(x);

Calculate

##### matrix-solve

e1:matrix([e1x],[e1y]);

e2:matrix([e2x],[e2y]);

m:matrix([0,1],[-1,0]);

Calculate 