Simulink assignment block writes garbage inside iterator subsystem.

조회 수: 19 (최근 30일)
Allan Yarbrough
Allan Yarbrough 2025년 11월 5일 20:13
I have an assignment block inside a complex model that I developed to run inside a time step. It should write a value to a 100-element array at the given index (zero-based). This is the expected behavior:
These are the assignment block parameters:
I then moved the model of which this was a part inside an iterated subsystem. Here is what I am getting:
The input U is being written to the array at the correct index, but the other elements of the array have been filled up with junk. (The "junk" in this case appears to be array values from MUCH earlier iterations before the array was re-initialized.) I note that this appears to only happen on this particular iteration; subsequent iterations overwrite the junk values at increasing indices as appropriate, but that is still leaving me with the value at the first index being incorrect.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Event Functions에 대해 자세히 알아보기

제품


릴리스

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by