📄 del2_5pt.m
字号:
function [output]=del2_5pt(input,delx)
% DEL2_5PT ... compute the 5 point Laplacian
%
% [output]=del2_5pt(input,delx)
%
% DEL2_5PT computes the 5 point approximation to the laplacian operator of
% the two dimensional matrix 'input'. The horizontal and vertical bin
% spacing of the matrix MUST be the same.
%x方向和z方向的空间采样率必须一致
% input = input matrix
% delx = the horizontal/ vertical bin spacing in consistent units%
% output = the output matrix
[nrows,ncolumns]=size(input);
input2=zeros(nrows+2,ncolumns+2);
input2(2:nrows+1,2:ncolumns+1)=input;
factor=1/(delx^2);
clear input
% for first dimension
output = (input2(3:nrows+2,2:ncolumns+1) - 2.*input2(2:nrows+1,2:ncolumns+1) +...
input2(1:nrows,2:ncolumns+1))*factor;
% for second dimension
output = (input2(2:nrows+1,3:ncolumns+2) - 2.*input2(2:nrows+1,2:ncolumns+1) +...
input2(2:nrows+1,1:ncolumns))*factor+ output;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -