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 次查看(过去 30 天)
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?

采纳的回答

Rik
Rik 2020-3-13
[num,txt]=xlsread('Sample.xlsx');
t=datetime(txt);
L=day(t)==29 & month(t)==2;
num(L,:)=[];
t(L,:)=[];

更多回答(1 个)

Alex Mcaulley
Alex Mcaulley 2020-3-13
编辑:Alex Mcaulley 2020-3-13
Another option:
[~,~,raw] = xlsread('sample.xlsx');
raw(contains(raw(:,1),'29/02'),:) = [];

类别

Help CenterFile Exchange 中查找有关 Dates and Time 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by