Coder deleting variable definitions
Afficher commentaires plus anciens
Why oh why does coder feel the need to delete my variable definitions from time to time? It is unbelievably frustrating having to redefine 200+ variables.
13 commentaires
Walter Roberson
le 13 Juin 2012
Adam, as a work-around, could you perhaps put the variable definitions into a different file and #include that file ?
Adam Kaas
le 13 Juin 2012
Walter Roberson
le 13 Juin 2012
Write the definitions into YourFileName.h. Then at the point in the C code that you need the variables defined, you would put the line
#include "YourFileName.h"
This has the effect of inserting everything from YourFileName.h as-if it had all been typed in at that point in the source.
Walter Roberson
le 13 Juin 2012
Note: the double-quote marks are important for the syntax.
Adam Kaas
le 13 Juin 2012
Kaustubha Govind
le 13 Juin 2012
Adam: Are these variables not being used in the rest of your code? I would expect the variable definitions to be removed only as an optimization.
Adam Kaas
le 13 Juin 2012
Walter Roberson
le 13 Juin 2012
This would not be an entry-point file.
Kaustubha Govind
le 14 Juin 2012
Are the variable zeta and w being used in some part of S1.m?
Adam Kaas
le 14 Juin 2012
Adam Kaas
le 14 Juin 2012
Kaustubha Govind
le 14 Juin 2012
Adam: I think I'm a little confused about your workflow. Perhaps you should consider sending your files and reproduction steps to MathWorks Tech Support and verify if this is expected behavior or a bug?
Adam Kaas
le 14 Juin 2012
Réponse acceptée
Plus de réponses (1)
Rich McKeever
le 26 Juin 2012
1 vote
Adam,
We saw your post about the issue here and fixed the bug yesterday. A patch is available here, but I also second Fred's suggestion of using other methods for defining large numbers of inputs.
Thanks,
Rich
Catégories
En savoir plus sur DSP Algorithm Acceleration dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!