Effacer les filtres
Effacer les filtres

save one matrix to another but with different precision

2 vues (au cours des 30 derniers jours)
Daniel Barzegar
Daniel Barzegar le 25 Juin 2014
Hi all, i have a matrix which includes float numbers and i want to save it into a new one, but in the new matrix i want to have more digits (compared to the 1st matrix) after the dot - precision.
Any ideas?

Réponses (1)

James Tursa
James Tursa le 25 Juin 2014
MATLAB supports IEEE 64-bit double precision floating point numbers (the default for constant numeric) and IEEE 32-bit single precision floating point numbers. They are displayed on your screen according to the current display option in effect, but the display does not affect the underlying numbers themselves. If you want to increase the number of digits displayed, you can type this at the command prompt:
format long
If you want to go back to fewer digits printed, you can type this:
format short
If you actually want to increase the precision of the underlying numbers, you will need to use something other than double or single. E.g., vpa from the Symbolic Toolbox, or HPF from John D'Errico:

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by