Coder deleting variable definitions
Show older comments
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 Comments
Walter Roberson
on 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
on 13 Jun 2012
Walter Roberson
on 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
on 13 Jun 2012
Note: the double-quote marks are important for the syntax.
Adam Kaas
on 13 Jun 2012
Kaustubha Govind
on 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
on 13 Jun 2012
Walter Roberson
on 13 Jun 2012
This would not be an entry-point file.
Kaustubha Govind
on 14 Jun 2012
Are the variable zeta and w being used in some part of S1.m?
Adam Kaas
on 14 Jun 2012
Adam Kaas
on 14 Jun 2012
Kaustubha Govind
on 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
on 14 Jun 2012
Accepted Answer
More Answers (1)
Rich McKeever
on 26 Jun 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
Categories
Find more on DSP Algorithm Acceleration in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!