creation of a histogram with RGB values (in .txt file)
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I would like to obtain the histogram in the figure below with the RGB values present in the .txt file.
In the .txt file.: The first column is Red. The second column is Green. The third column is Blue.
How can I do it?
0 commentaires
Réponses (1)
KSSV
le 12 Avr 2022
data = importdata('filename.txt') ;
h1 = histogram(data(:,1), 10);
h1 = h1.Values ;
h2 = histogram(data(:,2), 10);
h2 = h2.Values ;
h3 = histogram(data(:,3), 10);
h3 = h3.Values ;
clf
figure(1)
set(gca,'color','k')
hold on
bar(1:10, h1,'r')
bar(11:20, h2,'g')
bar(21:30, h3, 'b')
0 commentaires
Voir également
Catégories
En savoir plus sur Histograms dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!