centeredDifferenceKernels

PURPOSE ^

Creates the centered difference kernels

SYNOPSIS ^

function [Kcx, Kcy] = centeredDifferenceKernels(hx, hy)

DESCRIPTION ^

 Creates the centered difference kernels
 
 Input:
   hx: grid step size in X (defaults to 1 if not set)
   hy: grid step size in Y (defaults to hx if not set)
 
 Output:
   Kcx, Kcy: centered differences kernels in x/y

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [Kcx, Kcy] = centeredDifferenceKernels(hx, hy)
0002 % Creates the centered difference kernels
0003 %
0004 % Input:
0005 %   hx: grid step size in X (defaults to 1 if not set)
0006 %   hy: grid step size in Y (defaults to hx if not set)
0007 %
0008 % Output:
0009 %   Kcx, Kcy: centered differences kernels in x/y
0010 %
0011 
0012 Kcx = zeros(3, 3);
0013 Kcx(2, 3) = 0.5;
0014 Kcx(2, 1) = -0.5;
0015 Kcx = Kcx/hx;
0016 
0017 Kcy = zeros(3, 3);
0018 Kcy(1, 2) = -0.5;
0019 Kcy(3, 2) = 0.5;
0020 Kcy = Kcy/hy;
0021 
0022 end

Generated on Thu 10-Dec-2020 17:34:27 by m2html © 2005