orthrtc.m

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

M
66
字号
function orthrtc(filename, newfilename)
% orthrtc  - orthogonalize RTC object in file
%
% FORMAT:       orthrtc(filename [, newfilename]);
%
% Input fields:
%
%       filename    RTC file
%       newfilename SaveAs filename (default: *_orth.rtc)
%
% No output fields

% Version:  v0.7a
% Build:    7082721
% Date:     Aug-27 2007, 9:39 PM CEST
% Author:   Jochen Weber, Brain Innovation, B.V., Maastricht, NL
% URL/Info: http://wiki.brainvoyager.com/BVQXtools

% argument check
if nargin < 1 || ...
   ~ischar(filename) || ...
    isempty(filename)
    error( ...
        'BVQXtools:BadArgument', ...
        'Valid matrix of vectors without Inf/Nans are required.' ...
    );
end
filename = filename(:)';
if nargin < 2 || ...
   ~ischar(newfilename) || ...
    isempty(newfilename)
    [fp{1:3}] = fileparts(filename);
    if isempty(fp{1})
        fp{1} = '.';
    end
    newfilename = [fp{1} filesep fp{2} '_orth.rtc'];
end

% try loading RTC
rtc = [];
rtcl = true;
try
    [rtc, rtcl] = BVQXfile(filename);
    if ~isBVQXfile(rtc, 'rtc')
        error('NO_RTC');
    end
catch
    if isBVQXfile(rtc, true) && ...
        rtcl
        rtc.ClearObject;
    end
    error( ...
        'BVQXtools:BadArgument', ...
        'No RTC file loadable.' ...
    );
end

% orthogonalize RTCMatrix
rtc.RTCMatrix = orthvecs(rtc.RTCMatrix);

% SaveAs
rtc.SaveAs(newfilename);
if rtcl
    rtc.ClearObject;
end

⌨️ 快捷键说明

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