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!