MATLAB Answers

converting hourly plot(1:1:168) to days of week starting from Mond to Sund

1 view (last 30 days)
Awais Ahmad
Awais Ahmad on 22 Jul 2019
Edited: Awais Ahmad on 22 Jul 2019
[DayNumber, DayName]= weekday(TT2.time(1:24:168), 'short', 'en_US');
This my code for plotting T3mean, which is nearly 168 values with the hours having the same vector length. But I want to plot this hours in terms of day name starting from monday to sunday. How can I do that in matlab.
Should I use swtich loop or there is another method of doing this.
I have even used, the below command that gives me a char matrix of 7*3, but I still cannot replace it with my hour vector.
[DayNumber, DayName]= weekday(TT2.time(1:24:168), 'short', 'en_US');
Thank you for your time.


Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!