Simulink variant subsystem accepting multiple input dimensions

1 回表示 (過去 30 日間)
Robbin van Hoek
Robbin van Hoek 2016 年 3 月 13 日
コメント済み: Vineeth Kartha 2016 年 3 月 17 日
I have a question regarding variant model. I created a 'subsystem' in the form of a variant model that represents a certain part of my physical system. Within this variant model is only a Matlab function block that is coded such that it is able to accept inputs of various sizes (both scalars and arrays) and outputs are automatically adjusted to be of the same size.
However, once i start compilation of the main model, the variant model infers all signals to be scalars. Therefore the functions inside do not work anymore. I was wondering how i should specify the port dimensions such that it accepts multiple sizes of inputs. I understand that the compiler needs information about the maximum size of the arrays.
I can specify the maximum sizes and check the 'variable size' box. But then once I try to run a model which doesn't input arrays of this maximum size then the model returns an error.
Error using modelfunctioncaller (line 30)
Error in port widths or dimensions. Output port 1 of
'Test_block/Mux' is a one dimensional vector with 2 elements.
Error using modelfunctioncaller (line 30)
Error in port widths or dimensions. Input port 1 of
'Test_block/Model1' is a one dimensional vector with 4 elements.
How should i specify the sizes in the Matlab function block, within the variant model, such that it is able to accept multiple sizes?
Kind regards,
Robbin
  1 件のコメント
Vineeth Kartha
Vineeth Kartha 2016 年 3 月 17 日
Hi,
Will it be possible for you to share the model so that everyone gets a better understanding of what your MATLAB code does.
Regards
Vineeth

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by