mpt.parameter Structure Values Being Variant Dependent
19 ビュー (過去 30 日間)
古いコメントを表示
Mahmoud Hassanien
2019 年 11 月 7 日
コメント済み: Mahmoud Hassanien
2019 年 11 月 17 日
I have an mpt.parameter where value is a struct and data type is a Simulink.Bus.
For example:
tmp = mpt.Parameter;
% myStruct is supposed to be a struct defined before
tmp.Value = myStruct;
% myDT_tstrCalib is supposed to be a Simulink.Bus defined before with elements as many as myStruct
tmp.DataType = 'Bus: myDT_tstrCalib';
tmp.CoderInfo.StorageClass = 'Custom';
tmp.CoderInfo.Alias = 'myAlias_strCalib';
tmp.CoderInfo.CustomStorageClass = 'myCSC';
tmp.CoderInfo.CustomAttributes.MemorySection = 'RAM_CAL';
What I use in simulink blocks is
tmp.x
where x is a field in myStruct.
The upper code produces a structure with names as in myDT_tstrCalib and values as in myStruct when I generate code using embedded coder.
What I seek is using variant subsystems and having some of tmp being in more than one variant with different values.
what shall I do?
0 件のコメント
採用された回答
Mark McBroom
2019 年 11 月 9 日
You might be able to do this by turning the contents of each variant sub-system into reference model and then setting up each reference model to use instance specific parameters. See this link:
その他の回答 (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!