How can I match my dates?
4 views (last 30 days)
Show older comments
Hi!
I would like to know which function should I use to match my dates. I have a matrix of 3653X337 (including data for weekends) and a vector of 2609X1 (for dates without weekends. I would like to match the dates in the vector with those of the matrix.
Thanks a lot!
4 Comments
Answers (1)
Azzi Abdelmalek
on 16 Jul 2013
You can create 3653 days for your data, then remove the weekends from your array.
s1=datenum('01/01/2000','dd/mm/yyyy'); % Example of start day
s2=s1+3653-1;
d=s1:s2;
data=rand(3653,337); % Example of data
v=[d' data];
v(7:7:end,:)=[];
v(6:6:end,:)=[];
3 Comments
Azzi Abdelmalek
on 16 Jul 2013
Edited: Azzi Abdelmalek
on 16 Jul 2013
s1=datenum('01/01/2000','dd/mm/yyyy');
s2=s1+3653-1;
d=s1:s2;
idx=not(isbusday(d,[6 7])); % find 6th and 7th day of the week
data=rand(3653,337);
v=[d' data];
v(idx,:)=[];
See Also
Categories
Find more on Calendar in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!