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

1 回表示 (過去 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 Center および File ExchangeSignal Import and Export についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by