Does the Shift Arithmetic block support tunable expressions for code generation in Real-Time Workshop 7.1 (R2008a)?
显示 更早的评论
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.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Simulink Coder 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!