How to incrementally save output data from long Simulink simulation?

Hey everyone,
I'm using Simulink to compute the response of a linear, parameter varying system (LPV system). Within the simulation 24h data shall be generated with a sample frequency of 800 Hz. I'd like to save the output incrementally every 10 minutes.
My question is: How can I perform these blockwise savings?
Thanks
Stefan

 채택된 답변

You can specify the start and stop time of the simulation. The key point is to save the final state of the last simulation and use it as the initial state of the next simulation. Below is an example, you can change the loop number and insert the save command inside the loop to save your data.
vdp;
tStart='0';
tStop='10';
out=sim('vdp','StartTime',tStart,'StopTime',tStop,...
'SaveFormat','Structure',...
'SaveFinalState','On','FinalStateName','xFinal');
for k=1:1
tStart=tStop;
tStop=num2str(10+k*10);
x0=out.xFinal;
out=sim('vdp','StartTime',tStart,'StopTime',tStop,...
'SaveFormat','Structure',...
'LoadInitialState','On','InitialState','x0',...
'SaveFinalState','On','FinalStateName','xFinal');
end

댓글 수: 1

Hey,
this is also the solution I finally implemented successfully. Many thanks.
Stefan

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Communications Toolbox에 대해 자세히 알아보기

제품

릴리스

R2018a

질문:

2018년 5월 30일

댓글:

2018년 6월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by