I want to convert data(double precision,15 decimal points) to data of another type(quadruple precision,34 decimal points). So, I used vpa
function like this:
data = sin(2*pi*frequency*time);
quad_data = vpa(data,34);
But, the type of the result is sym
, not double
. And when I checked each cell of the sym
type data, 1x1 sym
was created in each cell. I tried to use fft
function using 'quad_data', but it didn't work. Is there any solution that I can change the decimal point of double type from 15 to 34?
There is a commercial 3rd-party toolbox for this purpose, called the Multiprecision Computing Toolbox for MATLAB.
This tool implements many of the mathematical operations you would expect from
double
inputs, and according to benchmarks on the website, it's much faster than vpa.Disclosure: I am not affiliated with the creators of this tool in any way, however I can say that we had a good experience with this tool for one of our lab's projects.
The other suggestion I can give is doing the high-precision arithmetic in an another language\environment to which MATLAB provides interfaces (e.g., C, python, java), and which should have the quad data type implemented.