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

2 次查看(过去 30 天)
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'); ?

采纳的回答

per isakson
per isakson 2014-2-28
编辑:per isakson 2014-2-28
Try
figure;
bar(1:3, cat(1,patient.percentages{:}), 0.5, 'stack');
  4 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Structures 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by