how can I increase accuracy
27 次查看(过去 30 天)
显示 更早的评论
I am working with a program that deals with very small numbers and I build a matrix that has this very small numbers, is there any way in matlab that I could increase accuracy to deal with this very small numbers like 1^(-12)? can I increase the number of digits that matlab use to save a number? thanks
0 个评论
回答(4 个)
Walter Roberson
2012-10-10
10^(-12) is not very small; MATLAB handles that easily.
MATLAB uses IEEE 754 double precision numbers, which have 53 bits of precision (approximately 1 part in 10^16)
You might want to look at the "format" command, to change the default display form of numbers.
0 个评论
José-Luis
2012-10-10
doc vpa
That would work, if you have the symbolic math toolbox.
2 个评论
José-Luis
2012-10-10
编辑:José-Luis
2012-10-11
Just look for vpa in the Matlab documentation. Or type doc vpa at the prompt. You can define a number to have whatever precision you want. It is rather slow though...
However, Walter might be right and you might have more of a display problem (especially if the data is already loaded into your computer). To see if that is so, just type format long in the prompt and look at your values again.
Matt J
2012-10-10
If you can transform your problem (e.g., by doing 1/x) to deal with very large integers, instead of very small floats, the following might be applicable to you
0 个评论
Andreas Goser
2012-10-10
The whole thing might be a display issue like others suggested or it is that the numbers are too small in comparison to other entries in a matrix and thus numberical operations are not returning results you expect. Here you may be abel to scale columns or rows by a factor like 1e3, 1e6
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!