display words in a matrix

2 views (last 30 days)
lowcalorie
lowcalorie on 15 Feb 2012
I need help I trying to display the 12 months in a 6x2 matrix then display them in a 6x2 in alphabetical order please help

Accepted Answer

Andrei Bobrov
Andrei Bobrov on 15 Feb 2012
out = reshape(sort(cellstr(datestr(datenum([zeros(12,1) (1:12).' ones(12,1)]),'mmm'))),2,[]);
please read about functions: reshape,sort,cellstr,datestr,datenum
  2 Comments
lowcalorie
lowcalorie on 15 Feb 2012
i got the moonths into a 12x1 but i am having trouble getting them to a 6x2
lowcalorie
lowcalorie on 15 Feb 2012
I got it thank you

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!