Higher precision in MATLAB App Designer

조회 수: 3 (최근 30일)
Tanu Singla
Tanu Singla 2021년 3월 9일
댓글: Tanu Singla 2021년 3월 10일
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?

답변 (2개)

Steven Lord
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
Tanu Singla
Tanu Singla 2021년 3월 10일
Steven, I am developing a GUI to create Mandelbrot sets which requires high level zoom in to the xy plot. With double precision, results cannot be obtained after a certain zoom.
Walter Roberson
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
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
Walter Roberson 2021년 3월 10일
In my experience, plots are done at single precision internally (though I no longer recall the context for that.)
Tanu Singla
Tanu Singla 2021년 3월 10일
I think quadruple precision should do just fine in my case.
Plots can be obtained at single precision but the way I am developing the GUI, it obtaines the x and y interval from the zoom in region of the plot only. If axes canot handle higher precision,I might have to change my algorithm.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Numbers and Precision에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by