save one matrix to another but with different precision
2 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
回答(1 个)
James Tursa
2014-6-25
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:
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Numeric Types 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!