frat.m

来自「为stanford大学donoho教授所编写的redgit变换源代码。是用c编写」· M 代码 · 共 34 行

M
34
字号
function [r, m] = frat(f)
% FRAT  Finite Radon Transform
%
%       [r, m] = frat(f)
%
% Input:
%       f:      a P by P matrix.  P is a prime.
%
% Output:
%       r:      a P by (P+1) matrix.  One projection per each column.
%       m:      (optional), normalized mean of the input matrix.
%               In this case, the mean is subtracted from each column of r.
%  
% See also:     IFRAT

if ndims(f) ~= 2
    error('Input must be a matrix of 2 dimensions');
end

p = size(f, 1);
if (size(f, 2) ~= p) | ~isprime(p)
    error('Input must be a P by P matrix, P is a prime number')
end

% Compute the best sequence of directions
s = bestdir(p);

% Calling the MEX file that does the actual computation of FRAT
if nargout == 2
    [r, m] = fratc(f, s);
else
    r = fratc(f, s);
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?