Can the output of the weekday function be modified to return different numbers?

1 次查看(过去 30 天)
Can the output of the weekday() function be modified like the excel weekday function so that Monday = 1 rather than Monday =2? I can always map it after the fact but it would be better if the function could just return the different number.

采纳的回答

Rik
Rik 2017-11-16
Depending on your release (and maybe even OS), you might be able to edit the internal Matlab function, but you shouldn't. It is best to modify your code to correct for the difference between what you need and what you get. (the mod function can help with the wrap-around)
Editing internal functions is a bad idea, because it removes any form of portability. If you choose to re-install Matlab, or install a newer release, you will have to re-apply the change, which might not be possible. You might also break other function (both internal function and function written by others (teachers/FEX submissions)).

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Calendar 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by