managing year and months

2 ビュー (過去 30 日間)
Seemab  Janjua
Seemab Janjua 2015 年 6 月 12 日
コメント済み: Seemab Janjua 2015 年 6 月 22 日
i have dataset in following formay M = [2015 1 5 ; 2015 1 6 ; 2015 2 6 ; 2014 3 6 ; ]
split like this A = [2015 1 5 ; 2015 1 6 ; ]
B = [2015 2 6 ;]
C = [2014 3 6 ]

採用された回答

Sean de Wolski
Sean de Wolski 2015 年 6 月 12 日
doc datetime
Now:
Mdt = datetime(M)

その他の回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2015 年 6 月 12 日
編集済み: Azzi Abdelmalek 2015 年 6 月 12 日
Use cell arrays instead of creating several variables.
M = [2015 1 5 ; 2015 1 6 ; 2015 2 6 ; 2014 3 6 ];
v=M(:,1:2);
[ii,jj,kk]=unique(v,'rows','stable');
out=accumarray(kk,1:numel(kk),[],@(x) {M(x,:)});
celldisp(out);
  1 件のコメント
Seemab  Janjua
Seemab Janjua 2015 年 6 月 22 日
Thanks Sir Azzi Abdelmalek ...

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

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by