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

2 Ansichten (letzte 30 Tage)
Adam S
Adam S am 25 Jun. 2019
Beantwortet: Adam S am 26 Jun. 2019
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

Antworten (2)

Jonas
Jonas am 26 Jun. 2019
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 Kommentar
Jonas
Jonas am 26 Jun. 2019
If my suggestion has no effect, please post the complete error posting you are getting, thanks!

Melden Sie sich an, um zu kommentieren.


Adam S
Adam S am 26 Jun. 2019
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

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by