Simulink For iterator , to output every loop result, not only the last cycle

조회 수: 6 (최근 30일)
Emma Storm
Emma Storm 2020년 9월 8일
답변: Amrtanshu Raj 2020년 9월 11일
Hi,
I have one short program,
N=4; v=[-1;-2;-3];
for i=2:N
A(:,i)=[zeros(i-1,1);v(1:N-i+1,1)];
end
I need to do this in Simulink. can anyone help me with this? Thanks a lot.
I have tried with For iterator in Simulink, but the output is only the result of last loop. And I need to have A concentrate with all loop cycle result.
Thanks a lot.
BR
Emma

답변 (1개)

Amrtanshu Raj
Amrtanshu Raj 2020년 9월 11일
Hi,
You can refer to this guide to export values out of Simulink at every step into output variable.
You can use an outport block and then go to Modelling -> Model Settings -> Model Settings -> Data import/Export to save the value of signal after each step of simulation.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by