Is it possible to output a NaN from the signal editor block?

조회 수: 2 (최근 30일)
Adam S
Adam S 2019년 6월 25일
답변: Adam S 2019년 6월 26일
I thought I had a signal editor outputting a signal which had NaN values for some parts. In a new model I tried to do it again but I only get an error that this is not allowed.
Is it possible to output a NaN from a signal editor and I just have some block/model settings wrong? Or did I imagine that I could do it before?
Thanks!
Adam

답변 (2개)

Jonas
Jonas 2019년 6월 26일
I don't exactly know which error your get, but maybe you just need to set the Diagnostic settings to not throw an error for NaN block outputs.
  댓글 수: 1
Jonas
Jonas 2019년 6월 26일
If my suggestion has no effect, please post the complete error posting you are getting, thanks!

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


Adam S
Adam S 2019년 6월 26일
Hey Jonas,
Thanks for the suggestion and sorry my original post was lacking in specifics and probably not so clear. Here is the actual error I get on compilation (simulation doesn't start running):
ErrorMsg.png
I did try to play with that setting you suggested in the Data Validity menu but it only changes the warning/error behaviour during a simulation.
At the moment I have a temporary solution but it is not ideal, I thought that the signal editor block could output NaN before but I can't actually find any evidence of it working for me previously so I could be incorrectly remembering the prior behaviour :)
Here is my temporary solution with the second signal generator requesting NaNs (but it is not ideal for my use case):
TempSoln.png

카테고리

Help CenterFile Exchange에서 Signal Import and Export에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by