Borrar filtros
Borrar filtros

<missing> displayed while i am printing the variable in command window

8 visualizaciones (últimos 30 días)
Moin Ali
Moin Ali el 5 de Ag. de 2020
Comentada: Moin Ali el 17 de Ag. de 2020
I am writing a power allocation module for NOMA and i am trying to display my array of value After iterations more than 1200 my module starts to display NAN in arrays.
I tried to debug the probabale cause of it and found that one of my variable starts displaying <missing> in command prompt after certain iterations and when that value is added in my final array it becoms aalso NAN.
Can any body share why <missing> is displayed in command prompt (scrrenshot is attached here)

Respuestas (1)

Walter Roberson
Walter Roberson el 5 de Ag. de 2020
<missing> is displayed for string objects ( **not** character vectors) when nan is assigned to the object.
Another way of saying this is that somewhere in your code you have an implicit or explicit conversion of number to string object, but you are trying to convert nan. When you do that then it converts to <missing>
>> "the y value is: " + nan
ans =
<missing>
The conversion does not produce
"the y value is: NaN"
You might want to rewrite anything like that to be more like
>> sprintf('the y value is: %f',nan)
ans =
'the y value is: NaN'
Note that the <missing> is not the source of your code problems: it is only happening when you have already generated a nan.
You might want to command
dbstop if naninf
and run your code. Sometimes you need to turn that setting on and off within a function to prevent the tests from getting distracted by code that is outside your control.
  1 comentario
Moin Ali
Moin Ali el 17 de Ag. de 2020
thankyou @Walter Roberson.
i apply this to my code and i found that it pause most of the time and i click on continue for the next iteration and after clicking many times it draw graph but the its size is not matched with vector so it not draw curve, si still its a problem for me ...

Iniciar sesión para comentar.

Categorías

Más información sobre Graphics Object Properties en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by