Two dimensional Q-function
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
Q(x1,x2,ro)=1/((1/sqrt(2*pi)*(1-ro^2))*int(int(exp(-(x^2+y^2-2roxy)/(2*(1-ro^2))) dxdy
The result may include a very small approximation error.
How to use it
To use the the file in your own program, just download the file and save it in the same path that your file is. You can call the 2d qfunction by:
answer=q2d(x1,x2,ro)
where x1 and x2 are the limit of the integrals and ro is the correlation coefficient.
Example:
>> q2d(-1.2,.3,.4)
ans =
0.3671
>>
Cite As
Hassan Moradi (2025). Two dimensional Q-function (https://www.mathworks.com/matlabcentral/fileexchange/28480-two-dimensional-q-function), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.