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'),:) = [];
  댓글 수: 1
Subhra Maity
Subhra Maity 2020년 3월 15일
편집: Subhra Maity 2020년 3월 15일
thanks.. it also does the same. only '29/02' should be changed to '29-02' as per the date format in excel file. :)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by