Code Directory
 Visual Basic & VB.NET
New Code
Australia Post eParcel For Magento 1.1.1
Source Control for SQL Server 2.0
Answers phpSoftPro 3.12
Exlcart 2.0
School College ERP 1.3.2
White-label Grocery Delivery App Solution 2.0
Best Classified Script 5.1
Readymade B2B Script 1.3.1
Uber Clone with Safety Measure Addons 2.0
Equity Investing Software 1.3.2
C# QR Code Generator 2020.6.0.0
The .Net PDF Library 2020.7.1
dbExpress driver for MySQL 7.2
dbForge Documenter for Oracle 1.2
dbForge Studio for Oracle 4.2
Top Code
dbExpress driver for MySQL 3.00
dbForge Studio for Oracle 3.10
Database Workbench Pro 5.7.4
Availability Booking Calendar PHP 1.0
ATN Site Builder 3.0
ATN Resume Finder 2.0
PHP Review Script 1.0
Invoice Manager by PHPJabbers 3.0
Aglowsoft SQL Query Tools 8.2
Solid File System OS edition 5.1
ICPennyBid Penny Auction Script 4.0
Classified Ad Lister 1.0
dbForge Data Generator for Oracle 2.2
Deals and Discounts Website Script 1.0.2
Extreme Injector 3.7
Top Rated
phpEnter 5.1.
Single Leg MLM 1.2.1
Azizi search engine script PHP 4.1.10
Paste phpSoftPro 1.4.1
Extreme Injector 3.7
Deals and Discounts Website Script 1.0.2
Solid File System OS edition 5.1
Classified Ad Lister 1.0
Aglowsoft SQL Query Tools 8.2
Invoice Manager by PHPJabbers 3.0
ICPennyBid Penny Auction Script 4.0
PHP Review Script 1.0
ATN Resume Finder 2.0
ATN Site Builder 3.0
Availability Booking Calendar PHP 1.0
2D Histogram Calculation 1.0
File ID: 86204

2D Histogram Calculation 1.0
Download 2D Histogram Calculation 1.0http://www.mathworks.comReport Error Link
License: Shareware
File Size: 10.0 KB
Downloads: 7
Submit Rating:
2D Histogram Calculation 1.0 Description
Description: function histmat = hist2(x, y, xedges, yedges)

Extract 2D histogram data containing the number of events of [x , y] pairs that fall in each bin of the grid defined by xedges and yedges. The edges are vectors with monotonically non-decreasing values.

The code is optimized no loop inside, it can be useful in the case of large dataset.


events = 1000000;
x1 = sqrt(0.05)*randn(events,1)-0.5; x2 = sqrt(0.05)*randn(events,1)+0.5;
y1 = sqrt(0.05)*randn(events,1)+0.5; y2 = sqrt(0.05)*randn(events,1)-0.5;
x= [x1;x2]; y = [y1;y2];

For linearly spaced edges:
xedges = linspace(-1,1,64); yedges = linspace(-1,1,64);
histmat = hist2(x, y, xedges, yedges);
figure; pcolor(xedges,yedges,histmat'); colorbar ; axis square tight;

For nonlinearly spaced edges:
xedges_ = logspace(0,log10(3),64)-2; yedges_ = linspace(-1,1,64);
histmat_ = hist2(x, y, xedges_, yedges_);
figure; pcolor(xedges_,yedges_,histmat_'); colorbar ; axis square tight;

License: Shareware

Related: linearly, spaced, linspace, sqrt randnevents, Dataset, figure, pcolorxedgesyedgeshistmat

O/S:BSD, Linux, Solaris, Mac OS X

File Size: 10.0 KB

Downloads: 7

More Similar Code

Hist2D performs a fast calculation of 2D histograms. On a 2GHz processor, calculated and displayed a histogram of 1 million points in less than half a second.

HIST2D 2D histogram

[H XBINS YBINS] = HIST2D(D, 'display' ...)

HIST2D calculates a 2-dimensional histogram and returns the histogram array and (optionally) the bins used to calculate the...

PGFHIST2D(X, Y, W) will save a PNG file representing the 2D histogram created from data points specified by X and Y with weights specified by W. The vectors X, Y, and W must have the same number of elements. The text to include in a Latex file to...

2D histogram: Extract the number of joint events - (x,y) data value pairs that fall in each bin of the grid defined by xedges and yedges.



which returns

1) N is a...

%A Simple function that makes a 2D histgram

% Input: data: two cols, x value; y value
% xrange: range and bins for x value (edges)
% yrange: range and bins for y value (edges)
%Output: Count of a specifice (x,y) bin...

function mHist = hist2d ([vY, vX], vYEdge, vXEdge)
2 Dimensional Histogram
Counts number of points in the bins defined by vYEdge, vXEdge.
size(vX) == size(vY) == [n,1]
size(mHist) == [length(vYEdge) -1, length(vXEdge) -1]

function H = histo2D(D,[Xlo Xhi],Xn,[Ylo Yhi],Yn,Xlab,Ylab,Title)

2-Dimensional Histogram
(size(H) == [Yn Xn])
Counts number of points in the bins defined by -
X = linspace(Xlo,Xhi,Xn) and
Y =...

SCATTERCLOUD creates a scatterplot from X and Y data sets, and overlays it on top of a density plot of the same data.

From the help:

SCATTERCLOUD display density of scatter data

SCATTERCLOUD(X,Y) creates a...

Generates a contour plot of a 2-column data set in which the 1st and 2nd column contains the X and Y variables, respectively.
Output variables can be specified interactively.
2D histogram output: Rows contain the distribution of the X...

This function creates a 2D scatterplot from two data vectors, and puts a univariate histogram for each vector at the horizontal and vertical axes of the plot.

Matlab code for calculation of 2d Gaussian Q function.

General description
This m-file provide a numerical computation of two-dimensional Gaussian Q-function, that is

User Review for 2D Histogram Calculation
- required fields

Please enter text on the image