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 visualización (últimos 30 días)
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?

Respuesta aceptada

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

Más respuestas (1)

Alex Mcaulley
Alex Mcaulley el 13 de Mzo. de 2020
Editada: Alex Mcaulley el 13 de Mzo. de 2020
Another option:
[~,~,raw] = xlsread('sample.xlsx');
raw(contains(raw(:,1),'29/02'),:) = [];
  1 comentario
Subhra Maity
Subhra Maity el 15 de Mzo. de 2020
Editada: Subhra Maity el 15 de Mzo. de 2020
thanks.. it also does the same. only '29/02' should be changed to '29-02' as per the date format in excel file. :)

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by