subtracting numbers from a date serial

1 次查看(过去 30 天)
suppose i have a matrix with the following numbers
736274
736273
736246
736245
736211
736210
736183
736182
i want to turn the above into the following
736274
736273
736272
736246
736245
736244
736211
736210
736209
736183
736182
736181
how can i do this? with the formula below i can only substract by one but i want to substract by one and two
result = reshape([date_num.'; date_num.'-1], [], 1);

采纳的回答

Star Strider
Star Strider 2015-11-7
It takes three lines, not one, but you’re close:
result = reshape(date_num, 2, []);
result = [result; result(end,:)-1];
result = result(:)
result =
736274
736273
736272
736246
736245
736244
736211
736210
736209
736183
736182
736181

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Clocks and Timers 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by