📄 extend1d.m
字号:
function b=extend1D(a,x)
%EXTEND1D extrapolate field in 1D
%
%y=extend1D(a,x)
%
%extrapolates a property defined between the nodes to values at the nodes
%
%x = vector defining the position of the nodes (length n)
%a = vector defining the values to be extrapolated (length n-1)
%y = extrapolated vector
%Copyright 1999 Martin Rother
%
%This file is part of AQUILA.
%
%AQUILA is free software; you can redistribute it and/or modify
%it under the terms of the GNU General Public License as published by
%the Free Software Foundation; either version 2 of the License, or
%(at your option) any later version.
%
%AQUILA is distributed in the hope that it will be useful,
%but WITHOUT ANY WARRANTY; without even the implied warranty of
%MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
%GNU General Public License for more details.
%
%You should have received a copy of the GNU General Public License
%along with AQUILA; if not, write to the Free Software
%Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
hx=diff(x);
nx=length(x)-2;
boxvol=hx(1:nx)+hx(2:nx+1);
b=[a(1) (hx(1:nx).*a(1:nx)+hx(2:nx+1).*a(2:nx+1))./boxvol a(end)];
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -