Signal dimensions propagation to submodels
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi, all!
I am trying to creare a submodel in simulink. In the submodel, there is one input port and one output port, and some image processing blocks inbetween. To encorporate submodel i use 'model' block (standard). The top-level model loads an image and passes it to the submodel. I have a problem, that image dimensions are determined for image loading block on during the compilation time (the load image block is implemented as Level-2 MATLAB function, path to the image is a parameter, in the setup() function image information is read and the dimensions of the output port are set based on this information), but for submodel the input port dimensions are somehow set to 1, although port dimenstions property for input port is set to inherit.
Why is it happening? Does anybody know the way to fix this?
Best regards, Alina
0 comentarios
Respuestas (1)
Kaustubha Govind
el 18 de Jun. de 2012
AFAIK, referenced models cannot inherit signal dimensions - if specified as Inherited (-1) on the port, by default it is assumed that the input is a scalar variable. This is done because the referenced model is compiled independently of the parent, so you must specify the input/output size, datatype and complexity. It looks like the sample time however can be inherited under some conditions.
In your case, since the referenced systems input size changes depending on a parameter in the parent, it might be better to copy the other model in as a subsystem instead of a referenced model.
2 comentarios
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!