Why does this showing inf?

10 Ansichten (letzte 30 Tage)
Farshad Afzali
Farshad Afzali am 20 Sep. 2017
Kommentiert: Christoph F. am 20 Sep. 2017
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)

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 20 Sep. 2017
Look at the value of 1\n .
Are you certain that you intended to use Matrix Left Divide rather than ./ ?
  3 Kommentare
Walter Roberson
Walter Roberson am 20 Sep. 2017
/ is Matrix Right Divide. You want Right Divide which is ./
Christoph F.
Christoph F. am 20 Sep. 2017
Forget my earlier answer, this is the correct one.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by