Answer is NaN??

1 visualización (últimos 30 días)
Yintong Zheng
Yintong Zheng el 27 de Feb. de 2016
Respondida: Walter Roberson el 27 de Feb. de 2016
<<
I insert tau, s, c, belta value at comment window and set "x=linspace(0,pi/2,101)". Why i get all those weird answer? Please help!!! >>
  1 comentario
the cyclist
the cyclist el 27 de Feb. de 2016
As has been commented before on your question, it is better to upload your actually code, not an image of it. Then, we can copy and paste the code ourselves and run it.
Please show the code for how you call this as well. Just a description doesn't really help.

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 27 de Feb. de 2016
You have, in part, (x-tau(k)).^(-1) . If there is any x equal to tau(k) then the subtraction would give 0 and raising that to power -1 would give infinity. Infinity times any non-zero value gives infinity (infinity times 0 gives nan), so you would be adding infinity to the value, resulting in infinity. And then since you are effectively totaling values, you are going to get an infinite result (unless one of the s or c or belta is 0 at just the right time, in which case you get nan)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by