Vpa conversion of whole file
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ahmet Parker
am 20 Apr. 2022
Bearbeitet: John D'Errico
am 22 Apr. 2022
Hi,
I have a matlab code which has many lines of code. I need variable precision arithmetic calculations. I want to use vpa and digits().
I do not want to convert all my files (inputs, assignments, initializations) into vpa() format. Is there an easy way to do it?
All my calculations will be in variable precision arithmetic (vpa). I want to see if using more digits change my results.
Thanks in advance
0 Kommentare
Akzeptierte Antwort
John D'Errico
am 22 Apr. 2022
Bearbeitet: John D'Errico
am 22 Apr. 2022
I'm sorry. You cannot now convert those files automatically, to take lines like
a = 5;
And automatically have MATLAB see those lines as
a = vpa(5);
with some number of digits specified, where all double precision numbers as created in all of your files are now converted automatically and on the fly to VPA.
Could you use some text processing to do so? That is possible if your code if pretty simplistic, but I would consider it suspect unless you are highly skilled at using tools like regular expressions in MATLAB, and even then, I'd be wary of bugs you may introduce.
Oh, and even if you could do this? Your code would now run quite slowly, because MATLAB is not optimized to use all symbolic computations.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Numbers and Precision finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!