Command use to convert expression E to numeric form
显示 更早的评论
Command use to convert expression E to numeric form
4 个评论
Walter Roberson
2021-6-30
Could you give an example?
Su Hyun Kim
2021-6-30
Su Hyun Kim
2021-6-30
Walter Roberson
2021-6-30
exp(1)
for the constant e
exp(x)
for 
回答(2 个)
Star Strider
2021-6-30
1 个投票
If ‘E’ is a symbolic expression (we have no idea exactly what it is), then matlabFunction could be appropriate to turn it into an anonymous function that could be executed numerically. If it is a symbolic scalar or vector, then vpa or double would be appropriate, depending on the desired result.
If none of these are appropriate, I will delete this Answer.
Maybe you mean the output to the command window?
format short
pi * 1e8
format long
pi * 1e8
format long g
pi * 1e8
You have more control using fprintf or sprintf to create the output.
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!