Higher precision in MATLAB App Designer
조회 수: 3 (최근 30일)
이전 댓글 표시
I am developing a GUI with App Designer and the calculations need precision upto 16 decimal places. Under normal circumstances "format long" can be used to increase the precision. How can high precision be obtained in the App environment?
댓글 수: 0
답변 (2개)
Steven Lord
2021년 3월 9일
The format function does not "increase the precision" of calculations. All it does is change how the values are displayed in the Command Window. If you want control over how the numbers are displayed in App Designer take a look at the sprintf function.
댓글 수: 5
Walter Roberson
2021년 3월 10일
Note that Mandelbrot may act differently with symbolic computation. Symbolic computation is modeled as if it were carried out in decimal, but if you search a while you can find references indicating that the computation is done in groups of 9 decimal digits (10^10 is just under 2^30).
But if you push the tests hard enough that doesn't quite work out and the implication would seem to be that rationals are stored in groups of 30 bits rather than in decimal. Design documents that talk about this are... scarce.
Symbolic floating point computation is carried out with 5 guard digits beyond the digits() setting, and appears to be calculated in decimal... maybe.
Steven Lord
2021년 3월 10일
How far do you expect your users to want to zoom in? What do you expect typical limits of the region of interest to be? If it falls within the limits of quadruple precision you may be able to calculate the results using Cleve's prototype or a MEX-file doing quad precision calculations in C or C++, but I don't know if you'll be able to plot it. My guess is that figures, axes, etc. won't be very happy trying to display numbers on the order of say 1e-4000.
댓글 수: 2
Walter Roberson
2021년 3월 10일
In my experience, plots are done at single precision internally (though I no longer recall the context for that.)
참고 항목
카테고리
Help Center 및 File Exchange에서 Numbers and Precision에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!