Combining several sets of data in an array into one numeric array to make a histogram
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Yat Chi
am 29 Dez. 2023
Kommentiert: Dyuman Joshi
am 29 Dez. 2023
I got 1826 set of data inside variable named X, each set of data inside has several numbers as data. I once use the variable to try making a histogram, but command window says only numeric array can achieve that. How can I transform all data into 1 numeric array and get the histogram. Thanks.
0 Kommentare
Akzeptierte Antwort
Dyuman Joshi
am 29 Dez. 2023
%Sample data
X = {rand(22,1); (1:22).'; primes(75).'}
Y = vertcat(X{:})
%Direct call to histogram(), specify the bins as required
histogram(Y)
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Histograms finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!