# Error in the creation of new tools - elementary operations in the rows of a matrix

Francisco Dutenhefner shared this question 2 years ago

Dear, I would like to create tools that perform elementary operations on the rows of a matrix.

For example, if a matrix A is given and the numbers a and b are given, the following command creates the matrix B obtained from A by replacing line a with line b.

B = Sequência(Sequência(Se(i ≟ a, Elemento(Elemento(A, b), j), Se(i ≟ b, Elemento(Elemento(A, a), j), Elemento(Elemento(A, i), j))), j, 1, Elemento(Dimensão(A), 2)), i, 1, Elemento(Dimensão(A), 1))

I would like to set up a new tool in GeoGebra, with

initial objects: A, a, b

final object: B

Although the command works perfectly, an error message appears when I try to create this new tool. Could you help me?

Thank you very much in advance. 2

Is this OK? 3

The input objects of a tool must be free when the tool is defined

see attached

really you need a custom tool for this?

Files: foro.ggb 2

Thanks mathmagic !!

attached: a somewhat simplified command for m2 1

I appreciate the help.

I understood where my error was and I managed to resolve it.

Now I created three tools:

TrocaLinha = exchange the position of two rows of a matrix.

MultiplicaLinha = multiplies a row by a scalar.

SomaLinha = adds to a row a scalar multiple of another row.

Thank you again