Matlab 分数转浮点数
在对具有一个变量的方程使用“求解”函数后,Matlab 似乎不喜欢使用浮点。 所以,我的答案是
ans = -2515439103678008769411809280/29019457930552314063110978530889-1/232155663444418512504887828247112*13479465975722384794797850090594238631144539220477565900842902305^(1/2)
,我不确定将其转换为可理解的小数的最佳方法是什么。 到目前为止,我拥有的最好的方法是
eval(char(ans))
(对于那些跟踪的人来说,它给了我-0.5002),但我对这个解决方案并不是很满意。
谁能建议更好的东西吗?
After using the 'solve' function on an equation with one variable, it seems like Matlab doesn't like using floating point. So, my answer is
ans = -2515439103678008769411809280/29019457930552314063110978530889-1/232155663444418512504887828247112*13479465975722384794797850090594238631144539220477565900842902305^(1/2)
and I'm not sure what the best way to convert it to an understandable decimal is. The best way I have so far is
eval(char(ans))
(which gives me -0.5002 for those keeping track), but I'm not really happy with that solution.
Can anyone suggest something better?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我查看的下一页就有了答案。 这是“双重”功能:
Well, the very next page I looked at had the answer. It's the 'double' function: