How to compare counts of each histogram
4 ビュー (過去 30 日間)
古いコメントを表示
Hello everyone, i hope you are doing well. i have the eight clusters. I want to calculate histogram for each cluster, after calculating histogram, i want to compare the count of each values if the count is greater in one cluster assign the value to other cluster and repeat the process till 8 clusters
How can i do that in MATLAB
I have the following code.
for i = 1:8
T = clusters{i}(:,2);
h1(i)=histogram(T,100000,'BinLimitsMode','manual','BinLimits',[0 3e8]);
end
7 件のコメント
回答 (1 件)
Saksham Gupta
2022 年 6 月 14 日
As per my understanding, you are unable to find the count value of histograms whose data is present with you.
‘Values’ attribute helps us to get bin count in histogram in MATLAB
Following code will help you in getting a cell array having count values of each Histogram:
clusters=num2cell(load('matlab.mat'));
h1= cell(1,8);
for i = 1:8
T = clusters{1,1}.clusters{i,1}(:,2);
z =histogram(T,100000,'BinLimitsMode','manual','BinLimits',[0 3e8]);
disp(z.Values)
h1{i}=z.Values;
end
You may also refer to the following documentation:
7 件のコメント
Image Analyst
2022 年 6 月 14 日
And the explanation???
s = load('matlab.mat')
clusters = s.clusters % a cell array
for k = 1 : numel(clusters)
subplot(3, 3, k);
histogram(clusters{k});
grid on;
ylabel('Count');
xlabel('Value');
end
What do the 5 columns, and variable number of rows represent?
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!