-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLGmn.m
33 lines (28 loc) · 925 Bytes
/
LGmn.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function [ LGout ] = LGmn( m, n, Nx, Ny, dx, dy, wx, wy, sign, varargin )
% [ LGout ] = LGmn( m, n, Nx, Ny, dx, dy, wx, wy, sign)
%
% This function creates a 2D LG(p,l) mode with width 'w' and sign for the
% 2nd index given by 'sign' ('sign' > 0 is positive, 'sign' < 0 is
% negative, and 'sign' == 0 is error).
%
% 'Nx' and 'Ny' are the parameters of number of pixels of the output
% matrix. 'dx' and 'dy' are the width of each pixel in the same units than
% 'w'.
%
% Copyright (c) 2014 GICO-UCM
% Number of arguments
if( nargin == 8 )
sign = 1;
elseif( nargin ~= 9 )
error( 'LGpl:CreationStage', 'BAD NUMBER OF ARGUMENTS.' );
end
% Check 'sign'
if( sign ~= 0 )
sign = sign/abs(sign);
else
error( 'LGpl:CreationStage', 'SIGN CANT BE NULL.' );
end
l = abs(m-n);
p = min(m, n);
LGout = LGpl(p, l, Nx, Ny, dx, dy, wx, wy, sign);
end