Command use to convert expression E to numeric form

Command use to convert expression E to numeric form

4 件のコメント

Walter Roberson
Walter Roberson 2021 年 6 月 30 日
Could you give an example?
Su Hyun Kim
Su Hyun Kim 2021 年 6 月 30 日
I do know either.. it just stated like that :/
Su Hyun Kim
Su Hyun Kim 2021 年 6 月 30 日
i think it's referring to E for the e^
Walter Roberson
Walter Roberson 2021 年 6 月 30 日
exp(1)
for the constant e
exp(x)
for

サインインしてコメントする。

回答 (2 件)

Star Strider
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.
Jan
Jan 2021 年 6 月 30 日

0 投票

Maybe you mean the output to the command window?
format short
pi * 1e8
ans = 3.1416e+08
format long
pi * 1e8
ans =
3.141592653589793e+08
format long g
pi * 1e8
ans =
314159265.358979
You have more control using fprintf or sprintf to create the output.

カテゴリ

タグ

質問済み:

2021 年 6 月 30 日

回答済み:

2021 年 6 月 30 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by