boxplot from a structured array
Afficher commentaires plus anciens
hi
i have a structured array it's like this
name_of_image(1).stats
name_of_image(2).stats
etc
in .stats is a whole load of variables, like stats.area
what is the simplest way of producing a box plot of e.g stats.area, while ensuring that the box plot is labeled correctly with the name_of_image
thanks
ps i tried a for loop to extract the information, but thought there must be a simpler way
x = [];
% nameArray = [] ;
for i = 1 : length(collated_data)
% nameArray(i) = collated_data(i).name;
for k = 1 : length(collated_data(i).stats)
x(i, k) = collated_data(i).stats(k).area;
if x(i, k) < 17
x(i, k) = NaN;
end
end
end
3 commentaires
the cyclist
le 13 Juil 2017
Modifié(e) : the cyclist
le 13 Juil 2017
Can you upload a MAT file with this variable in it?
cgenes
le 13 Juil 2017
the cyclist
le 13 Juil 2017
FYI, in your code the variable is named "area", but in the file it is "Area". So, you might need to fix that up in my code.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

