⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 double.m

📁 这是一个关于hht变换很有用的工具箱
💻 M
字号:
function d=double(c);
% COMPONENTS/DOUBLE converts a Components object into a double matrix
% Usage:
%  d=double(c);
%
% Parameters:
%  c: the Components object to convert
%
% Note:
%  This function will give an 'hht:unequal' error if 'dt's are not equal.

% Kenneth C. Arnold <kca5@cornell.edu> 2004-07-30

% Ensure that 'dt's are the same for each component; otherwise, the
% component is not exactly representable within a double matrix.
dt = get(c,'dt');
nc = get(c,'nc');
for i=1:nc
    if get(c,'dt',i) ~= dt
        error('hht:unequal', 'delta-t unequal in Components object.');
    end
end

% preallocate matrix
d = zeros(get(c,'npts'),nc);
% store
for i=1:nc
    s = c.d(i).stime - c.stime;
    e = c.d(i).etime - c.stime;
    d(fix(s/dt)+1:fix(e/dt)+1,i) = c.d(i).c;
end

⌨️ 快捷键说明

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