Removal of Unwanted Time Series Data from simout in Matlab Workspace

조회 수: 11 (최근 30일)
Hi,
I wonder if anyone may be able to offer a solution. I would like to remove the first 0.1s from simout workspace data (see below). The simout data is a 1x1 double time series containing the columns Time and Data:1.
I have written the following code to try and remove the first 0.1 seconds (the transient).
tMin = seconds(0.1);
Vce = simout;
Vce = Vce(Vce.Time >= tMin,:);
Vce.Time = Vce.Time - Vce.Time(1);
Vce=Vce(Vce.Time >= 0.1);
However, I get the following error
The logical indices in position 1 contain a true value
outside of the array bounds.
Error in Healthy_Boost_Converter (line 3)
Vce = Vce(Vce.Time >= tMin,:);
I wondered if anyone might know what I'm doing wrong?
Kind regards,
Andy

채택된 답변

Andy Wileman
Andy Wileman 2022년 2월 20일
I have managed to come up with a solution, just in case anyone has this problem again.
Firstly, I enabled Single Simulation output in the Configuration Parameters in Simulink.
Secondly, I was then able to use the following
t = out.simout.time(out.simout.time >=0.1); % get time from out.simout where time >= 0.1
Vce = out.simout.data(out.simout.time>=0.1,1); % get data from data where time >= 0.1
plot(t,Vce)

추가 답변 (0개)

카테고리

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

태그

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by