필터 지우기
필터 지우기

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

조회 수: 8 (최근 30일)
Moin Ali
Moin Ali 2020년 8월 5일
댓글: Moin Ali 2020년 8월 17일
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)

답변 (1개)

Walter Roberson
Walter Roberson 2020년 8월 5일
<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
Moin Ali
Moin Ali 2020년 8월 17일
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 ...

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by