Clear Filters
Clear Filters

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 view (last 30 days)
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?

Accepted Answer

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

More Answers (1)

Alex Mcaulley
Alex Mcaulley on 13 Mar 2020
Edited: Alex Mcaulley on 13 Mar 2020
Another option:
[~,~,raw] = xlsread('sample.xlsx');
raw(contains(raw(:,1),'29/02'),:) = [];

Categories

Find more on Dates and Time in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!