I want to find frequency of occurrence histogram of paired values in 3d. I have two variables and values taken with same time. A=[1.1;2.3;2.5;1.1;1.6;1.1;2.3] and B=[3.3;2.1;1.2;3.3;2.1;3.3;2.1]. these values taken at 7 different time intervals.

 Akzeptierte Antwort

Image Analyst
Image Analyst am 4 Mär. 2017
Try histogram2():
A=[1.1;2.3;2.5;1.1;1.6;1.1;2.3]
B=[3.3;2.1;1.2;3.3;2.1;3.3;2.1]
numBins = 5;
histogram2(A, B, numBins)
xlabel('A', 'FontSize', 20);
ylabel('B', 'FontSize', 20);

5 Kommentare

Mubashir
Mubashir am 4 Mär. 2017
Bearbeitet: Mubashir am 5 Mär. 2017
Undefined function or variable 'histogram2'. I am using matlab 2015a. And I want final histogram like this image.
You'll have to have way, way more data points, and have much, much smaller bins. Alternatively you could take the 2-D histogram that histogram2() gives you and use surf() and contour() and colormap() to do the plotting.
Mubashir
Mubashir am 5 Mär. 2017
yes i have data of hundreds points. I am trying to get this. But now "Undefined function or variable 'histogram2'." I am using matlab 2015a. Thanks for help
It was introduced in R2015b. Can you upgrade? You're now 2 years behind.
Otherwise look at hist3() or similar functions.
Mubashir
Mubashir am 5 Mär. 2017
Thank you all..

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by