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

1 vue (au cours des 30 derniers jours)
Adam S
Adam S le 25 Juin 2019
Réponse apportée : Adam S le 26 Juin 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

Réponses (2)

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

Connectez-vous pour commenter.


Adam S
Adam S le 26 Juin 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

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by