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?
2 个评论
Rik
2020-3-13
What data type is your data in? Can you provide some code that generates example data?
采纳的回答
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
2020-3-13
编辑:Alex Mcaulley
2020-3-13
Another option:
[~,~,raw] = xlsread('sample.xlsx');
raw(contains(raw(:,1),'29/02'),:) = [];
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!