Substituting values into variables in a Matrix in MuPad

55 Views Asked by At

I have defined a matrix:

A := matrix([[1,-x,x],[2*x,-10,2*x],[2*x,2*x,4]]);

                        +-               -+
                        |   1,   -x,  x   |
                        |                 |
                        |  2 x, -10, 2 x  |
                        |                 |
                        |  2 x, 2 x,  4   |
                        +-               -+

and would like to substitute in the value of x = 2 into the matrix. How would I do this in Mupad? Regenerating a new matrix is not an option.

1

There are 1 best solutions below

0
Dean P On

Substitution works only if I install the linear algebra package through the following command:

export(linalg);

Now I can try the command...

subs(A, x = 2);

... which works, but never worked prior to installing the linalg package.