Coder deleting variable definitions
Ältere Kommentare anzeigen
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 Kommentare
Walter Roberson
am 13 Jun. 2012
Adam, as a work-around, could you perhaps put the variable definitions into a different file and #include that file ?
Adam Kaas
am 13 Jun. 2012
Walter Roberson
am 13 Jun. 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
am 13 Jun. 2012
Note: the double-quote marks are important for the syntax.
Adam Kaas
am 13 Jun. 2012
Kaustubha Govind
am 13 Jun. 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
am 13 Jun. 2012
Walter Roberson
am 13 Jun. 2012
This would not be an entry-point file.
Kaustubha Govind
am 14 Jun. 2012
Are the variable zeta and w being used in some part of S1.m?
Adam Kaas
am 14 Jun. 2012
Adam Kaas
am 14 Jun. 2012
Kaustubha Govind
am 14 Jun. 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
am 14 Jun. 2012
Akzeptierte Antwort
Weitere Antworten (1)
Rich McKeever
am 26 Jun. 2012
1 Stimme
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
Kategorien
Mehr zu DSP Algorithm Acceleration finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!