필터 지우기
필터 지우기

How to set an array parameter with variable size for simulink model

조회 수: 2 (최근 30일)
少冰
少冰 2022년 8월 18일
편집: 少冰 2022년 8월 18일
I want to set an array parameter can be filled by the model user (who is also a developer) in the generated source file (like .h file in C language) and the length of this array is not limited. And then, I can get the size of this array in the model and traverse it.
For example, the model generate a source file as:
const int THE_ARRAY_PARAMETER[] = { 1, 2, 3 };
The model user can filled it, such as:
const int THE_ARRAY_PARAMETER[] = { 10, 20, 30, 40, 50 };
I can get the size of THE_ARRAY_PARAMETER and traverse it in the model.
But I don't know how to set this kinds of array parameter in the model and how to get the size of the array.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by