How do I create a stacked bar graph from values in a structured array?

8 vues (au cours des 30 derniers jours)
Golnar
Golnar le 28 Fév 2014
Commenté : ROMIL le 28 Fév 2014
If I have a structured array
patient.percentages = { [02 08 09]; [23 20 24]; [] }
and I want to create a stacked bar graph (with each bar having three sections like in the []), how do I draw upon these elements in my bar code?
figure; bar(1:3, [percentages], 0.5, 'stack'); ?

Réponse acceptée

per isakson
per isakson le 28 Fév 2014
Modifié(e) : per isakson le 28 Fév 2014
Try
figure;
bar(1:3, cat(1,patient.percentages{:}), 0.5, 'stack');
  4 commentaires
Golnar
Golnar le 28 Fév 2014
Thank you!
ROMIL
ROMIL le 28 Fév 2014
That was of great help!

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by