getfield.m

来自「神经元信号处理软件」· M 代码 · 共 25 行

M
25
字号
function field=getfield(d,name, idx)
% getfield - returns any datastream fields content (datastrm method)
% field = getfield(d,name, idx) returns the content
% of the field <name> in the datastream object <d>
%
% If <name> has more than one elements these can
% be indexed with <idx>, which must be a cell array
% of integers.
%
% Example
% If 'MCRackdatafile.0000' were a file with 2 datastreams
% e.g. 'Spikes 1' and 'Trigger 1', then
%
% d = datastrm('MCRackdatafile.0000');
% SN = getfield(d, 'StreamNames', {1}); 
%
% will return the first of the stream names only.

ds = struct(d);

if nargin ==3 
   field = getfield(ds, name, idx);
else
   field=getfield(ds, name);
end;

⌨️ 快捷键说明

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