I'm new to Matlab and I did some test.
format longG
a = [1 -1 -1 3; 2 -1 -3 1; 3 2 -5 2; 3 1 2 2]
b = adjoint(a)
a * b
The result looks like this:
As you can see, there are a lot .9999999... and e-14 or e-15. These e-14 or e-15 numbers are actually all 0s. How can I get precise result?
I did a similar calculation in Mathematica, and below is the result.
How can I get this similar result in Matlab? Thanks.

 Respuesta aceptada

madhan ravi
madhan ravi el 19 de Jun. de 2020
Editada: madhan ravi el 19 de Jun. de 2020

0 votos

a * sym(b)

3 comentarios

Ivor Horton
Ivor Horton el 19 de Jun. de 2020
Thank you! This works. By the way, I have to use sym() from the first calculation in order to get what I want. Should I always use sym() in order to get precise result? Are there any guidelines?
Ivor Horton
Ivor Horton el 19 de Jun. de 2020
Thanks again!

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Preguntada:

el 19 de Jun. de 2020

Comentada:

el 19 de Jun. de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by