필터 지우기
필터 지우기

Why does code generator transform matrix to array?

조회 수: 1 (최근 30일)
Simulinker
Simulinker 2014년 12월 22일
답변: Simulinker 2015년 3월 12일
Hi all,
I have a matrix (lets say of dimension 2x3), that is used in an interp1-function in my Simulink model. This interpolation interpolates only one dimension of the matrix, so the result is of dimension 3. Which is correct so far.
Generating c code (ert target) makes the matrix of dimension 2x3 an array of dimension 6. The result of the calculation in the code is still correct, by I need the matrix still to be a matrix (for calibration purpose).
Anyone an idea why the matrix is transformed to an array and how I can avoid this?
Thanks for your help.

채택된 답변

Simulinker
Simulinker 2015년 3월 12일
Not an answer to my question, but a work around if anyone has a similar problem: instead of using the interp1 function I now use a Lookup Table. Here I can set the matrix as the table data. Nevertheless in the code it's still an array, but at least it's defined as a matrix in the a2l file now.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by