Azzera filtri
Azzera filtri

How to delete from timeseries ?

9 visualizzazioni (ultimi 30 giorni)
John Doe
John Doe il 16 Set 2017
Commentato: John Doe il 19 Set 2017
Hello Everyone,
I am not really good at matlab and I am dealing with a time series data. The times series format is dd/mm/yyyy, I have attached a picture of the format.
My time series ranges from 1949 to 2017, my problem is if I want to delete a specific year in this time series, lets say 1949 along with data that comes with it...How do remove it from my time series?
I tried a bunch of time series commands such as delsample...but it didn't work. I don't know how to get about this.
If more information is needed please let me know,
Thank you.

Risposta accettata

Walter Roberson
Walter Roberson il 16 Set 2017
Assuming your data is in variable ts, and using the example of wanting to delete multiple years:
mask = ~ismember(year(ts.Time), [1949, 1950]);
new_ts = getsamples(ts, mask);
  7 Commenti
Walter Roberson
Walter Roberson il 19 Set 2017
Year = year(ts.Time/24 + datenum(ts.TimeInfo.StartDate));
mask = ~ismember(Year, 1949);
new_ts = getsamples(ts, mask);
John Doe
John Doe il 19 Set 2017
Thank You!! This works!
But what was my problem?

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by