Why does this showing inf?

9 ビュー (過去 30 日間)
Farshad Afzali
Farshad Afzali 2017 年 9 月 20 日
コメント済み: Christoph F. 2017 年 9 月 20 日
Hi guys,
I appreciate it if some one can tell me what's the problem with my code that shows inf?
n=linspace(1,10^9,10);
y=exp(1);
e=(1+(1\n)).^n;
error=abs(y)-abs(e)/abs(y)

採用された回答

Walter Roberson
Walter Roberson 2017 年 9 月 20 日
Look at the value of 1\n .
Are you certain that you intended to use Matrix Left Divide rather than ./ ?
  3 件のコメント
Walter Roberson
Walter Roberson 2017 年 9 月 20 日
/ is Matrix Right Divide. You want Right Divide which is ./
Christoph F.
Christoph F. 2017 年 9 月 20 日
Forget my earlier answer, this is the correct one.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by