Plotting matrix data without existing x-values.
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have this simple matrix, where the first column indicates the number of males of age 0 to 99 (first row, age 0, second row age 1 etc.)
The second column indicates the same for women.
How can I plot this nicely?
Thanks
0 commentaires
Réponse acceptée
Stephen23
le 28 Fév 2024
S = load('befolkning2019.mat');
M = S.befolkning2019
X = 0:size(M,1)-1;
plot(X,M)
legend('male','female')
2 commentaires
Aquatris
le 28 Fév 2024
S = load('befolkning2019.mat');
M = S.befolkning2019;
X = 0:size(M,1)-1;
bar(X,M)
xlabel('age')
ylabel('# of People')
legend('male','female')
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Line Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!