File Exchange

image thumbnail

Custom 2D Gauss

version 1.0 (1.26 KB) by

Generates a customized 2D gauss

8 Ratings



No License

Create a custom 2D gauss, which can be used for filtering, weighting, etc. All parameters are customizable, including standard deviations (sigmaX, sigmaY), rotation (theta), result size, center, etc.

Comments and Ratings (8)


Doe (view profile)

The second function should be changed into this:
function val = rotgauss(y, x, theta, sigmax, sigmay, offset, factor, center)
x and y is flipped in the original code


Mirko (view profile)


Morten (view profile)

Nice job Thomas, though it seems like you've switched sigmax and sigmay - comments?

Duane Hanselman: The nested loops are not necessary - use [rows,cols] = meshgrid(1:gsize(1),1:gsize(2)); and modify the remaining code to avoid them...

Andreas Sprenger

Great, very flexible, just what we want to have. THX

benedicte dupuis

Rene Michels

No big deal, Just works!
THX a lot for sharing!

Yi fan


Duane Hanselman

Might be worthwhile, but help text is not helpful. No error checking is done. Are nested For loops required?

MATLAB Release
MATLAB 7.0.1 (R14SP1)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video