MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   Matlab分数到浮点 (https://www.labfans.com/bbs/showthread.php?t=22638)

poster 2019-12-10 16:49

Matlab分数到浮点
 
在对具有一个变量的方程式上使用“求解”功能后,Matlab似乎不喜欢使用浮点数。所以,我的答案是

ans = -2515439103678008769411809280/29019457930552314063110978530889-1/232155663444418512504887828247112*13479465975722384794797850090594238631144539220477565900842902305^(1/2) 而且我不确定将其转换为可以理解的十进制的最佳方法是什么。我到目前为止最好的方法是

eval(char(ans)) (这使我获得-0.5002的跟踪记录),但是我对该解决方案并不满意。

谁能提出更好的建议?


回答:
好吧,我看的[URL="http://matlab.izmiran.ru/help/techdoc/matlab_prog/ch11_st4.html"]下一页[/URL]有了答案。这是“双重”功能:

double(ans)

[url=https://stackoverflow.com/questions/728789]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 23:29

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.