timerange in a loop
Show older comments
is it possible to put dates into a loop used in timerange function?
for i=2012:2016;
s(i)=timerange('i-01-01','i-02-01')
end
Accepted Answer
More Answers (2)
Sulaymon Eshkabilov
on 19 Oct 2019
Hi,
What about this:
for ii=2012:2016
H{ii-2011} = [num2str(ii), '-01-01',' : ', num2str(ii), '-02-01'];
end
Good luck.
1 Comment
Ugur Acar
on 19 Oct 2019
Sulaymon Eshkabilov
on 19 Oct 2019
How about this way:
for ii=2012:2016
H{ii-2011,1} = [num2str(ii), '-01-01'];
H{ii-2011, 2}= [num2str(ii), '-02-01'];
end
Categories
Find more on Logical 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!