psctrans.m

来自「toolbox of BVQX, This is the access betw」· M 代码 · 共 54 行

M
54
字号
function [psctc, pscf] = psctrans(tc, dim)
% psctrans  - perform PSC transformation on time course
%
% FORMAT:       [psctc, pscf] = psctrans(tc, [dim])
%
% Input fields:
%
%       tc          time course data
%       dim         temporal dimension (default: 1)
%
% Output fields:
%
%       psctc       PSC transformed time course
%       pscf        PSC transformation factor
%
% See also ztrans

% Version:  v0.5c
% Build:    6120415
% Date:     Dec-04 2006, 3:15 PM CET
% Author:   Jochen Weber, Brain Innovation, B.V., Maastricht, NL
% URL/Info: http://wiki.brainvoyager.com/BVQXtools

% check arguments
if nargin < 1 || ...
   ~isa(tc, 'double') || ...
    isempty(tc)
    error( ...
        'BVQXtools:BadArgument', ...
        'Invalid time course data given.' ...
    );
end
if nargin < 2 || ...
   ~isa(dim, 'double') || ...
    numel(dim) ~= 1 || ...
    isinf(dim) || ...
    isnan(dim) || ...
    fix(dim) ~= dim || ...
    dim < 1 || ...
    dim > length(size(tc))
    dim = 1;
end

% get repmat argument
stc = ones(1, length(size(tc)));
stc(dim) = size(tc, dim);

% build mean and then PSC factor
pscf = mean(tc, dim);
pscf = 100 ./ pscf;

% build PSC (psctc = 100 * tc / M(tc))
psctc = tc .* repmat(pscf, stc);

⌨️ 快捷键说明

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