Simulink model argument (for model referencing) with unknown array size

조회 수: 7 (최근 30일)
Ken
Ken 2013년 8월 27일
댓글: Number seven 2022년 10월 5일
Suppose I have a model ('mdlRef') which is intended to be referenced by a top level parent model ('mdlTop'). 'mdlTop' is responsible for setting the value of a variable ('tableData') in 'mdlRef'.
However, when 'mdlRef' was designed, the size of 'tableData' is unknown and therefore set to some arbitrary size in its model workspace. If 'mdlTop' were to set 'tableData' to a different size, an error occurs:
Invalid dimensions for parameter argument 'tableData' of Model block 'mdlTop/mdlRef'. The parameter provided is a [1x3] array but a [1x1] array is expected
Is there a way to workaround this problem? The same problem also prevents 2 instances of the same model reference to be assigned different sized data (which is quite common for look up tables) by the parent model.
  댓글 수: 4
db1024
db1024 2021년 5월 19일
Still true in R2020b.
I could also not find a corresponding note in the documentation. Is there any update on this issue?
Number seven
Number seven 2022년 10월 5일
Still true in R2021b, looking forward to an update to this issue!

댓글을 달려면 로그인하십시오.

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2013년 8월 27일
I don't think there is a workaround for this situation. The sizes and types of parameters cannot change after compilation. However, I'd recommend that you verify this with MathWorks Tech Support and submit an enhancement request with a use-case if they confirm the limitation.
  댓글 수: 1
aguadopd
aguadopd 2016년 9월 11일
편집: aguadopd 2016년 9월 11일
Still true in 2015b. May you point to some article of the Documentation that refers to this limitation? There is nothing over here.
EDIT: maybe here is a key, as it says "Model block is context-independent, so it cannot inherit signal properties. Explicitly set input and output signal properties."... Anyway, is a parameter "inheritance"?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Model References에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by