MATLAB Answers

0

use more digits in computing in matlab

Asked by Maryam on 19 Feb 2019
Latest activity Answered by John D'Errico
on 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?

  0 Comments

Sign in to comment.

1 Answer

Answer by John D'Errico
on 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.

  0 Comments

Sign in to comment.