Create model with input of variable size
古いコメントを表示
Hello everyone,
I'm trying to create a simple model with a input that should be an array with size determined by a parameter that can be changed for any istance of the referenced model.
I have tried different things but I'm still not able to create it and i havent' found nothing similar into documentation.
Anyone has advice for this kind of problem.
Best regards.
Claudio
6 件のコメント
John D'Errico
2026 年 7 月 7 日 12:23
Be specific, not vague, at least if you want good help. There must be dozens of tools in MATLAB that can work with a "model" in some form, in as many ways. Explain what you are doing, far more clearly. Wha tool are you using? Is this a question about Simulink? Or perhaps a regression model of some form?
Claudio Rosso
2026 年 7 月 7 日 13:13
Walter Roberson
2026 年 7 月 7 日 18:15
How will the block accept the input? From Workspace? From File? Constant Block with parameter set() by a MATLAB script?
Claudio Rosso
2026 年 7 月 8 日 7:05
Isha
2026 年 7 月 10 日 10:04
Hello,
Based on your description, a bounded variable-size signal seems like the right approach. Configure the referenced model Inport as variable-size and specify an upper bound. This allows the root model to provide arrays of different lengths while remaining compatible with C code generation. Unbounded variable-size signals are not supported for C code generation.
Documentation:
Hope this helps.
Claudio Rosso
2026 年 7 月 13 日 10:15
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Simulink Functions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!