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?

4 ビュー (過去 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
Rik 2020 年 3 月 13 日
What data type is your data in? Can you provide some code that generates example data?
Subhra Maity
Subhra Maity 2020 年 3 月 13 日
Here I have attached a sample excel file.

サインインしてコメントする。

採用された回答

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 Center および File ExchangeData Import from MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by