Why does this showing inf?

10 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by