Hi there,
I have an N x M table and I am trying to create M histograms on different plots, I can't seem to figure out how to plot them on different figures. If I hold on, they all plot on the same axis'
data = readtable('file.csv');
predictors = data(:,1:width(data)-1);
headers = predictors.Properties.VariableNames;
statarray = grpstats(predictors,[],{'mean','std'})
for k = width(headers);
a = table2array(predictors(:,k));
histogram(a)
title(headers(1,k))
end
I'm also not sure why I can't pass a table row to a histogram and need to table2array the data.
Any help would be greatly appreciated. Thank you
1 Comment
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/663933-creating-m-histograms-from-an-nxm-table-on-separate-plots#comment_1180118
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/663933-creating-m-histograms-from-an-nxm-table-on-separate-plots#comment_1180118
Sign in to comment.