removing samples from a timeseries between certain time intervals
古いコメントを表示
Hi there!
I have a large amount of timeseries (voltage, current, power, etc.) collected from a smart grid simulation. Every 900 seconds there is a spike in all of the values for only a fraction of a second. I know it would probably be easier to fix the cause of the spikes instead of doing it this way, but assuming the cause of the spikes is unfixable, is there a way to remove all samples of a timeseries in between a certain time interval?
This way I can set the interval to a little before every multiple of 900s and a little after 900s and fix the problem this way.
It has to be noted that I used a variable solver to run the simulation in Simulink, so the timeseries doesn't have fixed timestamps and the amount of timestamps differ from timeseries to timeseries.
I will attach a picture below where you can see the problem.

All help would be greatly appreciated!
Kind Regards
Alexander
回答 (1 件)
Sulaymon Eshkabilov
2021 年 5 月 28 日
Hi Alexander,
The answers to you posed questions as follows in the order of your questions:
(1) Remove specific timeseries:
T = ttot; % All time series
IND = (1:10:length(T)); % Select and keep every 11th value. You can choose whichever value needed
Tnew = T(IND);
Y = Ytot;
Ynew = Y(IND); % Newly reselected or downsampled signbal values
In your Simulink model you can set up odesolver's settings to fixed-step solver and you will get fixed number of solutions/simulation values. By default, the solver setting is a variable step solver.
Good luck.
3 件のコメント
Alexander Van Waeyenberge
2021 年 5 月 28 日
Sulaymon Eshkabilov
2021 年 5 月 28 日
Just deleting specific set of data is quite simple, e.g:
T(899:900) = [];
Fixed vs. flexible option depends on one's exercise type. I don't know the simulation time constraints and accuracy tolerances of your exercise, and thus, you need to simulate, verify and choose the right one.
Good luck.
Alexander Van Waeyenberge
2021 年 5 月 28 日
カテゴリ
ヘルプ センター および File Exchange で MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!