## `student::equateMatrix` -- build a matrix equation

#### Introduction

`student::equateMatrix(`A, vars`)` returns the matrix equation

    A[1..r,1..c-1] * vars = A[1..r,c..c]

#### Call(s)

`student::equateMatrix(A, vars)`

#### Parameters

`A` | - | matrix (of category `Cat::Matrix`) over a `Cat::Field`
`vars` | - | list of indeterminates

#### Returns

an expression of the domain type `DOM_EXPR` and of type `"equal"`.

#### Related Functions

`linalg::expr2Matrix`, `matrix`

#### Details

- `student::equateMatrix`(`A`,`vars`) returns the matrix equation

      A[1..r,1..c-1] * X = A[1..r,c..c]

  where r and c are the row and column number of `A`, and x_1, ..., x_r are the elements of `vars`.

- The number of indeterminates given in `vars` must match the row number of the matrix `A`.

#### Example 1

Let us construct the equation A*X=b. First we construct A and b:

    >> Ab := matrix( [[1,2,3],[-1,3,0]] )

                                  +-          -+
                                  |   1, 2, 3  |
                                  |            |
                                  |  -1, 3, 0  |
                                  +-          -+

Here we have A = [[1,2],[-1,3]] and b = [3,0]. Now we construct the equation A*X=b:

    >> student::equateMatrix( Ab,[x1,x2] )

                            +-             -+   +-   -+
                            |   x1 + 2 x2   |   |  3  |
                            |               | = |     |
                            |  - x1 + 3 x2  |   |  0  |
                            +-             -+   +-   -+

#### Example 2

We should be carefull to use the right dimension of the matrix and the indeterminates:

    >> Ab := matrix( [[1,2,3],[-1,3,0]] )

                                  +-          -+
                                  |   1, 2, 3  |
                                  |            |
                                  |  -1, 3, 0  |
                                  +-          -+

    >> student::equateMatrix( Ab,[x1,x2,x3] )

          Error: dimension of matrix and number of vars don't match [stu\
          dent::equateMatrix]

#### Changes

- In previous MuPAD versions it was also possible to specify the indeterminates in a set. But the elements of a set have no order so in this situation the matrix equation was not uniquely defined.

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000