Stateflow Runtime Error (chart): Matrix(matrix) subscript turned out to be a vector(vector) subscript with shape different from compiled assumption.

1 次查看(过去 30 天)
Hello, I have been trying to run a MATLAB function block in simulink with variable size input and output data. The compilation was successful but I get a run time error stating:
Stateflow Runtime Error (chart): Matrix(matrix) subscript turned out to be a vector(vector) subscript with shape different from compiled assumption. The error is present in the following line:
[crcDetCbData, crcCbFlags(cbIdx),iters(cbIdx)] = step(turboobject, in, intrlvIndices);
where turboobject is an instance of commLTETurboDecoder, in -input data intrlvindices is the indices for interleaving.
the function file runs without any error in MATLAB. But when I implement the same in Simulink I get the above error.
I am using this model for my project. It would be very helpful if anyone can provide a solution the earliest.

回答(1 个)

Ryan Livingston
Ryan Livingston 2015-3-15
The issue is described in detail, with workarounds, in the documentation:
In short, when indexing with non-scalars, the output generally has the size of the index, unless the array being indexed is a vector. To generate more efficient code with variable-sized arrays, the requirements are made more strict for code generation.

类别

Help CenterFile Exchange 中查找有关 Simulink Coder 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by