use more digits in computing in matlab

2 Ansichten (letzte 30 Tage)
Maryam
Maryam am 19 Feb. 2019
Beantwortet: John D'Errico am 19 Feb. 2019
I wrote an iterative solver code in matlab, in which a value update itself usign some computations. In each computation there is an error, which I would like to minimize by using more decimal integers. Any suggestions about how to use more decimal points in computations?

Antworten (1)

John D'Errico
John D'Errico am 19 Feb. 2019
Sorry. Unfortunately, you cannot simply request more precision in your computations in MATLAB.
The trick is to learn to do your computations in more effective ways. Otherwise, there are problems where you would need infinitely many decimal digits to solve them.
Having said that, CAN you do computations in higher precision? Well, yes. You can use the symbolic toolbox, with VPA. Or you can use my own HPF toolbox, downloaded from the File Exchange, where it is free. (Big Integer computations can be done using my VPI toolbox, also for free download from the FEX.)
In fact though, almost always, you are better off just learning to use numerical methods more efficiently. High precision is a crutch that is too easy to rely on, and is is a SLOW crutch. You pay for the higher precision in a great cost of time. Note that I'm the author of not one, but TWO different such tools for big number computations, and I'm telling you that you will be better off truly learning numerical methods.

Community Treasure Hunt

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

Start Hunting!

Translated by