Can the output of the weekday function be modified to return different numbers?
2 views (last 30 days)
Show older comments
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.
0 Comments
Accepted Answer
Rik
on 16 Nov 2017
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 Comments
More Answers (0)
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!