Higher precision in MATLAB App Designer

3 visualizzazioni (ultimi 30 giorni)
Tanu Singla
Tanu Singla il 9 Mar 2021
Commentato: Tanu Singla il 10 Mar 2021
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?

Risposte (2)

Steven Lord
Steven Lord il 9 Mar 2021
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 Commenti
Tanu Singla
Tanu Singla il 10 Mar 2021
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 il 10 Mar 2021
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.

Accedi per commentare.


Steven Lord
Steven Lord il 10 Mar 2021
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 Commenti
Walter Roberson
Walter Roberson il 10 Mar 2021
In my experience, plots are done at single precision internally (though I no longer recall the context for that.)
Tanu Singla
Tanu Singla il 10 Mar 2021
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.

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by