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)

 Respuesta aceptada

Walter Roberson
Walter Roberson el 20 de Sept. de 2017

1 voto

Look at the value of 1\n .
Are you certain that you intended to use Matrix Left Divide rather than ./ ?

3 comentarios

Farshad Afzali
Farshad Afzali el 20 de Sept. de 2017
Thanks Walter for answer,
Yes, when I put / instead of \ matlab gave me an error saying Error using / Matrix dimensions must agree.
Walter Roberson
Walter Roberson el 20 de Sept. de 2017
/ is Matrix Right Divide. You want Right Divide which is ./
Christoph F.
Christoph F. el 20 de Sept. de 2017
Forget my earlier answer, this is the correct one.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 20 de Sept. de 2017

Comentada:

el 20 de Sept. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by