forwardDifferenceKernels

PURPOSE ^

Creates the forward difference kernels

SYNOPSIS ^

function [Kfx, Kfy] = forwardDifferenceKernels(hx, hy)

DESCRIPTION ^

 Creates the forward 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:
   Kfx, Kfy: forward difference kernels in x/y

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [Kfx, Kfy] = forwardDifferenceKernels(hx, hy)
0002 % Creates the forward 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 %   Kfx, Kfy: forward difference kernels in x/y
0010 %
0011 
0012 Kfx = zeros(3, 3);
0013 Kfx(2, 2) = -1;
0014 Kfx(2, 3) = 1;
0015 Kfx = Kfx/hx;
0016 
0017 Kfy = zeros(3, 3);
0018 Kfy(2, 2) = -1;
0019 Kfy(3, 2) = 1;
0020 Kfy = Kfy/hy;
0021 
0022 end
0023

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