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

📄 get.m

📁 一种新的时频分析方法的matlab源程序。
💻 M
字号:
function val = get(c, prop, idx)
% COMPONENTS/GET gets properties of a Components object
%
% Usage:
%  val = get(c, prop [,idx])
%
% Parameters:
%  c    - the Components object to query
%  prop - the name of the desired property
%  idx  - the index of the component to query (0 for the whole data)
%
% Valid properties are:
%  'stime': start time
%  'etime': end time
%  'dt':    delta-t, or time increment per point
%  'npts':  number of data points
%  'nc':    number of components
%  'data':  vector or matrix with raw data
%
% Hint: you can also access these properties like a MATLAB structure:
%  nc = c.nc
%  dt1 = c.dt(1)
%  component2 = c.data(2);
% etc.

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

if nargin == 2; idx=[]; end
if isempty(idx) idx=0; end

if idx < 0 | idx > length(c.d)
    error('components/get: index out of range');
end

switch prop
    case 'stime'
        if idx==0
            val = c.stime;
        else
            val = c.d(idx).stime;
        end
    case 'etime'
        if idx==0
            val = c.etime;
        else
            val = c.d(idx).etime;
        end
    case 'dt'
        if idx==0
            val = (c.etime-c.stime)/(max(max(size([c.d.c])))-1);
        else
            val = (c.d(idx).etime-c.d(idx).stime)/(max(size(c.d(idx).c))-1);
        end
    case 'npts'
        if idx==0
            val = max(max(size([c.d.c])));
        else
            val = max(size(c.d(idx).c));
        end
    case 'nc'
        val = length(c.d);
    case 'data'
        if idx==0
            val = double(c);
        else
            val = c.d(idx).c;
        end
    otherwise
        error([prop ' is not a valid Components property']);
end

⌨️ 快捷键说明

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