Does the Shift Arithmetic block support tunable expressions for code generation in Real-Time Workshop 7.1 (R2008a)?
Show older comments
I have a Shift Arithmetic block in my model whose "Number of bits to shift right" parameter is set to a variable "Shift" which is defined as follows:
Shift = mpt.Parameter;
Shift.RTWInfo.StorageClass = 'ExportedGlobal';
Shift.Value = 2;
In the generated code, the arithmetic shift statement contains a constant rather than a variable. For example, the statement appears as follows:
out = in >> 2;
Setting the Storage class of the parameter to 'ImportedExtern' or using Custom Storage classes did not help.
Accepted Answer
More Answers (0)
Categories
Find more on Simulink Coder in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!