필터 지우기
필터 지우기

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 CenterFile Exchange에서 Component-Based Modeling에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by