transform.m
来自「快速泊松方程求解--MATLAB Fast Poisson Solver in」· M 代码 · 共 19 行
M
19 行
%
% Written by M. Harper Langston - 5/10/00
% harper@cims.nyu.edu
%
% Fast sine transform for poisson.m. Only need one since our Q matrix is orthogonal
function s = Transform(m,p)
const = -sqrt(2/(m+1));
for k = 1:m
% Take the kth vector from the long vector, p, and set it to q.
q = p((k-1)*m +1:k*m);
% Take the 2*m +2 fft of [0;q]
w = const*(fft([0;q],2*m+2));
% Take imaginary part of w and throw away the first element and last m+1 elements.
s((k-1)*m +1:k*m) = imag(w(2:m+1));
end
%
% Written by M. Harper Langston - 5/10/00
% harper@cims.nyu.edu
%
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?