Simulink variant subsystem accepting multiple input dimensions
조회 수: 1 (최근 30일)
이전 댓글 표시
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
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 Exchange에서 Component-Based Modeling에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!