How to copy subsystem parameters from one model to another

5 ビュー (過去 30 日間)
John Eganhouse
John Eganhouse 2022 年 6 月 28 日
回答済み: Muthukumar Ganesan 2022 年 7 月 12 日
I am having some issues with copying the initial conditions from one masked subsystem to another. I need to do this because I am testing a number of neural networks. The parameters represent the initial conditions/preprocessed inputs which are different for each new network. These Values from the 'Parameters' section I need to copy from one model to another. I can't just copy the entire block since the structure of the source block is slightly different than the destination.
See destination below destination block.
See initial masked block:
The block is called NARX Neural Network in both models but the contents are not the same, however the mask parameters are the exact same just the values will change. When I use get_param for 'DialogParameters' I get:
These structs don't contain the actual values. I don't know what commands I should use to copy the source initial conditions and place them in the destination. I'm not sure what other relavant information I could include. The release is actually 2019a because of depricated simscape multibody elements in the model but that shouldn't effect this question I think compared to 2022a. Thanks in advance.
  2 件のコメント
John Eganhouse
John Eganhouse 2022 年 6 月 28 日
編集済み: John Eganhouse 2022 年 6 月 28 日
I don't know if this will help but here is the view from the mask editor panel (part of image is cut off unless you expand the it):
John Eganhouse
John Eganhouse 2022 年 6 月 28 日
I can extract a single param with:
get_param('Network/NARX Neural Network','pi_input_1_delayed_1')
I guess this will work if I use a series of eval() commands in a loop but I assume there is a better way to just grab the whole set?

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

採用された回答

Muthukumar Ganesan
Muthukumar Ganesan 2022 年 7 月 12 日
Hi,
Please use the following command to copy the Mask parameter values from source block to destination if the order and number of parameters are same.
set_param(<DestBlockPath>,'MaskValueString',get_param(<SrcBlockPath>,'MaskValueString'))
Thanks.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSequence and Numeric Feature Data Workflows についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by