How can I add a day on a datestr equation?
2 次查看(过去 30 天)
显示 更早的评论
I am having trouble understanding the serial number concept of date commands.
I want to sum five days on the command datestr(now)
I am proceding the following way
x = datestr(now,1)
ans =
27-Sep-2012
I want to add up five days (y = 7 days) so that x + y =
2-Oct-2012
Can you please help?
0 个评论
采纳的回答
Star Strider
2012-9-27
编辑:Star Strider
2012-9-27
For example:
x = datestr(now,1)
y = 5;
z = addtodate(datenum(x), y, 'day');
zs = datestr(z,1)
gives:
x =
27-Sep-2012
zs =
02-Oct-2012
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!