i want to put this in order from smallest to largest population instead of alphabetical order. How can I do this?
clcclear allclose all%reading the file
[numbers text]=xlsread('homelesspopinamerica.xlsx');%manipulating withthe data and storing it at our convenience
statenames=text(2:51,1:2);pop=numbers(1:50,:);states=statenames(:,2);state=statenames(:,2);homepop=pop(:,2);homeperc=pop(:,4);totpop=pop(:,3);states=categorical(states);%plotting
figurebar(states,homepop)xlabel('States', 'Fontsize', 18)ylabel('Numer of Homeless Persons (Millions)', 'Fontsize', 18)title('HOMELESSNESS IN AMERICA 2017', 'fontsize', 24);set(gcf,'color','w');set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);%turn on grid lines
set(gca,'XGrid','off')set(gca,'YGrid','on')
Best Answer