How to add warning message when using simulink and code generation?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi!
I'm trying to add a custom warning message into a simulink model, which also should be able to work with code generation. I've got no luck in finding a function or how to add such message without the model crashing. I've tried the function warning and sldiagviewer.reportWarning in a matlab function block, but they are not compatible with code generation and I receive the error: "The 'sldiagviewer' class does not support code generation" or "Function 'warning' not supported for code generation.". Could this be solved in some way?
//T
0 commentaires
Réponses (1)
Sarthak
le 26 Avr 2024
Hey Tove,
The assertion block might be able to help you out. However, it also depends on your use case. The following MATLAB Answer might be helpful too:
The assertion block is supported for code generation however not recommended for production code.
Hope this helps!
0 commentaires
Voir également
Catégories
En savoir plus sur Sources dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!