How to have warnings generated in app designer app display in the command window.

3 vues (au cours des 30 derniers jours)
Christopher Marry
Christopher Marry le 5 Août 2021
Commenté : Dave B le 6 Août 2021
In many of the functions that run inside my app (created with appdesigner), there are various conditions that cause warnings to be generated. When I run these functions oustide of the app, the warnings print in the command window as expected, but when I run the code in app designer, the warnings don't get printed to the command window. However, I know that the warnings have been triggered, because running
lastwarn
in the command window will cause the most recent warning that should have already been printed to show up in the command window. I don't think it's an issue with my code, because I created an fresh app with a single button that does nothing but print 'hello world', and the warning still doesn't show up in the command window.
Is there some sort of setting I need to change for warnings generated in an app to properly display in the command window? Or are warnings not supported in this manner in appdesigner? If warnings aren't supported, how can I have some way of knowing which warnings (potentially hundreds) were generated from code running in an app?
  1 commentaire
Dave B
Dave B le 6 Août 2021
I just made a quick empty appdesigner app with a button, and in the callback for that button I put:
warning("DANGER!")
Whenever I hit the button I see a warning in the Command Window. (I also tried this by calling some code I knew would produce a warning rather than throwing the warning myself)
  • Is it possible that something in your app is turning off warnings? (if you set a breakpoint in your app, where you're expecting a warning, and call warning with no input arguments, does it report that warnings are off, or that some warnings are off?)
  • If you manually put a warning in a callback, does it display in the command window?

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by