You’re encountering this issue because, during code generation, Simulink requires each filter coefficient to appear as a fixed scalar or fixed-size vector parameter in the generated C code.
When you write something like "a(1,1)" inside the mask, it means “look up the first element of the tunable matrix a” at runtime. While this works fine in simulation (since MATLAB can dynamically index into arrays), code generation must produce static definitions. Dynamic indexing into a tunable parameter matrix such as "a" isn’t supported.
To fix this, you should explicitly configure all the mask parameters for partitioning in the "For Each Subsystem" block. In the block’s "Parameter Partition" tab, list each parameter (like "a1", "a2", "b0", "b1", "b2") and specify their "Partition Dimension" and "Partition Width".
This way, Simulink knows exactly how to slice these parameters before build time, and the generated code can create static, per-partition variables instead of using runtime indexing.
Below is an example model with the above configurations-
Mask parameters for the "For Each Subsystem"-
Parameter Partition for the "For Each"-
I hope this resolves your query!