I have daily data from 1969 to 2018. I want to remove the rows corresponding to 29-02 day from the matrix. How should I proceed?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Subhra Maity
am 13 Mär. 2020
Bearbeitet: Subhra Maity
am 15 Mär. 2020
I have daily data from 1969 to 2018. I want to remove the rows corresponding to 29-02 day from the matrix. How should I proceed?. Is there any in built function for this?
2 Kommentare
Rik
am 13 Mär. 2020
What data type is your data in? Can you provide some code that generates example data?
Akzeptierte Antwort
Rik
am 13 Mär. 2020
[num,txt]=xlsread('Sample.xlsx');
t=datetime(txt);
L=day(t)==29 & month(t)==2;
num(L,:)=[];
t(L,:)=[];
Weitere Antworten (1)
Alex Mcaulley
am 13 Mär. 2020
Bearbeitet: Alex Mcaulley
am 13 Mär. 2020
Another option:
[~,~,raw] = xlsread('sample.xlsx');
raw(contains(raw(:,1),'29/02'),:) = [];
1 Kommentar
Siehe auch
Kategorien
Mehr zu Dates and Time finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!