How to combine for-each subsystems with mask parameters in Simulink

조회 수: 1 (최근 30일)
James
James 2021년 10월 22일
댓글: James 2021년 11월 2일
I would like to simulate an array of identical masked subsystems that are each parameterized by a structure: i.e.
clear all_params
for i = 1:5
this_param.gain = i;
this_param.bias = -i;
all_params(i) = this_param;
end
Then the subsystems are parameterized with:
Is there a way to do this in a "for-each" subsystem? e.g.:
It looks like you can partition parameters, but it doesn't look like that works with structure arrays or anything not a matrix. I attached the simple model if it helps.
  댓글 수: 1
James
James 2021년 11월 2일
I figured out my problem! I was close, but when you "grow" a structure array in a loop (e.g. all_params(i) = this_param;) it populates it in the column direction. So, the example system works by either:
Specifying the "partition dimension" in the "for each" block to "2"
OR
Specifiying the structure array to be a row vector (e.g. all_params(i,1) = this_param;)

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

답변 (0개)

카테고리

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

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by