char array comparison
4 ビュー (過去 30 日間)
古いコメントを表示
I have a large char array and these are dates so the array has elements as: 20070801 20070802 20070803 etc.
This array shows up as 100x8 in the workspace. I want to get all the dates which are less than 20070915. How do I use the 'find' function to achieve this or any other straight forward method?
0 件のコメント
採用された回答
Paulo Silva
2011 年 3 月 15 日
a=['20070801';'20070802';'20070803']; %some date values
b=20070802; %value to compare
a(find(str2num(a)<b),:) %date values older than the compared value
0 件のコメント
その他の回答 (1 件)
Walter Roberson
2011 年 3 月 15 日
You could datenum() the dates and compare them to datenum() of your search date.
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!