How can I return numbers into days of a specific month
Show older comments
Hello everyone, I have a matrix with size of 2688*2, each cell contains a number that represents a day in the month, for example from 1 to 31, but each number is repeated like 96 times or sometimes less or more, the matrix looks like something close to 1 1 1 1 1 1 1 (96 times) then 2 2 2 2 2 (90 times) and so on until 31 or 30 or 28 depending on the month, this month is January of 2007, how can i please return those numbers into day names, for example the first day which is 1 in the matrix was Thursday in January 2007 .
Thank you in advance very much guys
8 Comments
Walter Roberson
on 22 Sep 2017
Edited: Walter Roberson
on 22 Sep 2017
What is the difference between this and your earlier https://www.mathworks.com/matlabcentral/answers/355773-how-to-convert-numbers-to-days-names#answer_280805 ?
If the issue is that you do not have explicit month numbers to work with, then I showed you how to adjust for that in https://www.mathworks.com/matlabcentral/answers/357613-how-can-i-select-specific-rows-and-sum-the-values-later#answer_282455
MAHMOUD ALZIOUD
on 25 Sep 2017
Walter Roberson
on 25 Sep 2017
My code line
day_of_week = weekday( datenum(entry_date) );
would give one result for each row of your data. The line
monday_data = YourData(day_of_week == 2, :);
is then needed to select down to just Mondays.
MAHMOUD ALZIOUD
on 25 Sep 2017
MAHMOUD ALZIOUD
on 25 Sep 2017
MAHMOUD ALZIOUD
on 25 Sep 2017
Stalin Samuel
on 25 Sep 2017
For better understanding kindly attach the data or specify the data format clearly
MAHMOUD ALZIOUD
on 25 Sep 2017
Answers (0)
Categories
Find more on Language Fundamentals 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!