# How to display fraction in matrix cells in text box

tphanyamada shared this question 2 years ago

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.

1

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

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

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.

1

Hello

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

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

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))

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.

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))

1

otra sugerencia

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