How to display fraction in matrix cells in text box

tphanyamada shared this question 2 years ago
Answered

Dear all,

I wrote an app to find the inverse of a matrix.

I'd like the answer displaying on the graphic screen as fractions instead of decimals.

For example, find the inverse of A = {{7,2}, {2,1}}.

I'd like the answer showing on the graphic screen for Cell (1,1) as 1/3, not 0.3333.

How could I do that?

Thank you so much for your help.

Comments (7)

photo
1

If you use the Invert command in CAS View, the inverse matrix is displayed with fractions.

e.g. Invert({{1, 2}, {3, 4}})

photo
1

Thank you, Simona!

On my Algebra view I see fractions but not in the graphic view.

I tried your advice but don't know how to display it on graphic view.

Could you please share with me a file on CAS view?

Thank you.

photo
1

Hello

In CAS, right clic line 2 >> Copy as LateX

00598dce1cb1a6e4ddcf46bc48c507dc

In Graphics, create a text >> Formula LaTeX, then copy (ctrl + V) in the Edit Box

8a95ea427f35371a6b58f32c25c5a5a6

photo
photo
1

I have a solution :

type the command : Tableau(Séquence(Séquence(FractionTexte(Elément(Inverser(A), i, j)), i, 1, 2), j, 1, 2))

photo
1

Hi Seror,

Thank you for the code. I got it.

The code below is in English version.

TableText(Sequence(Sequence(FractionText(Element(Invert(A), i, j)), i, 1, 2), j, 1, 2))

Thank you so much for your help.

photo
1

Actually you have to swap i and j. Otherwise, you'll get the transpose matrix of the inverse of A

Here is the correct code in English.

TableText(Sequence(Sequence(FractionText(Element(Invert(A), j, i)), i, 1, 2), j, 1, 2))

photo
1

otra sugerencia

TableText(Zip(Zip(FractionText(k), k, m), m, Invert(A)), "()c")

© 2022 International GeoGebra Institute