Subsystem can not reference partitioned mask parameter

5 ビュー (過去 30 日間)
Devyani Varshney
Devyani Varshney 2023 年 9 月 25 日
コメント済み: Devyani Varshney 2024 年 9 月 13 日
I am trying to partition mask parameters for each subsystem block, however keep getting the following error while developing the C code:
Parameter 'a1' of block 'blankSystry/inputtry/Subsystem' cannot reference partitioned mask parameter 'i' of For Each subsystem 'blankSystry/inputtry' because parameter 'a1' will be reduced to a numerical value.
Caused by:
  • The generated code will inline the numeric value of the expression 'a(i,1)' (used in parameter 'a1' of 'blankSystry/inputtry/Subsystem') because the expression is either referencing an element of a variable which is a mask parameter or has two or more dimensions, or is referencing an element of a one-dimensional variable using multiple indices. This expression resolves to tunable variables (i).
  2 件のコメント
hugo jageschwo
hugo jageschwo 2023 年 11 月 1 日
I have the same problem.
Devyani Varshney
Devyani Varshney 2023 年 11 月 1 日
yeah, I finally converted those masked parameters as seperate inputs. There is no way around.

サインインしてコメントする。

採用された回答

Pramil
Pramil 2024 年 9 月 13 日
Hi Devyani,
I encountered a similar error with MATLAB R2022b. To resolve it, I changed the "Mask Parameter" property, tunable from “on” to off, which successfully generate code.
Currently I am using MATLAB R2023a and this issue does not occur in it, so you can upgrade your MATLAB version as well to resolve the same.
For your reference, I have attached a model.
  2 件のコメント
Devyani Varshney
Devyani Varshney 2024 年 9 月 13 日
The parameter needs to be a tunable. I should be able to change it.
Devyani Varshney
Devyani Varshney 2024 年 9 月 13 日
matlab version could be the reason though. I was using 2022b that time.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSubsystems についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by