Simulink variant subsystem accepting multiple input dimensions

2 visualizaciones (últimos 30 días)
Robbin van Hoek
Robbin van Hoek el 13 de Mzo. de 2016
Comentada: Vineeth Kartha el 17 de Mzo. de 2016
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 comentario
Vineeth Kartha
Vineeth Kartha el 17 de Mzo. de 2016
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

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Component-Based Modeling en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by