How can I change precision in Matlab?

2 visualizaciones (últimos 30 días)
Kyriacos Patsalides
Kyriacos Patsalides el 26 de Abr. de 2017
Comentada: Stephen23 el 26 de Abr. de 2017
I am comparing some values between Fortran 90 and Matlab. The calculated value of A in Fortran has 20 digits, thus when calculating B it also has 20 digits. The same calculations are made in Matlab but the calculated value of A has 15 digits, thus the calculation of B will be different from the B calculated in Fortran.
How can I make Matlab calculating everything with a precision of 20 digits such as Fortran does?

Respuestas (1)

KL
KL el 26 de Abr. de 2017
  2 comentarios
Kyriacos Patsalides
Kyriacos Patsalides el 26 de Abr. de 2017
I tried that one but then Matlab gives my an error. I know that Matlab can provide up to 16 digits but I don't know if i must have like a specific version of Matlab that will allow me to use vpa
Stephen23
Stephen23 el 26 de Abr. de 2017
@Kyriacos Patsalides: vpa does not require a special version of MATLAB, but it is a part of the symbolic toolbox. If you do not have that toolbox installed and have a license for it then you will not be able to use it.

Iniciar sesión para comentar.

Categorías

Más información sobre Fortran with MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by