How to import mixed date format into matlab
1 回表示 (過去 30 日間)
古いコメントを表示
Abaye Getahun Abebe
2018 年 4 月 14 日
回答済み: Walter Roberson
2018 年 4 月 14 日
I have the following date columns parts of them: (yyyy mm dd) parts of them: (yyyy mmdd) parts them: (yyyymmdd)
I just want to import into matlab with separate columns of year, month, and days.
please have a look the textfile attached
採用された回答
Walter Roberson
2018 年 4 月 14 日
fid = fopen('01643000.txt');
datacell = textscan(fid,'%8c%f%f%f%f%f', 'CollectOutput',true);
fclose(fid);
years = str2double(cellstr(datacell{1}(:,1:4)));
months = str2double(cellstr(datacell{1}(:,5:6)));
days = str2double(cellstr(datacell{1}(:,7:8)));
other_data = datacell{2};
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
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!