Removal of Unwanted Time Series Data from simout in Matlab Workspace

5 visualizaciones (últimos 30 días)
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

Respuesta aceptada

Andy Wileman
Andy Wileman el 20 de Feb. de 2022
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)

Más respuestas (0)

Categorías

Más información sobre Simulink Functions en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by