Filter löschen
Filter löschen

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

8 Ansichten (letzte 30 Tage)
Moin Ali
Moin Ali am 5 Aug. 2020
Kommentiert: Moin Ali am 17 Aug. 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)

Antworten (1)

Walter Roberson
Walter Roberson am 5 Aug. 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 Kommentar
Moin Ali
Moin Ali am 17 Aug. 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 ...

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Graphics Object Properties finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by