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