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

조회 수: 6 (최근 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 Functions에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by