Home > vbmeg > functions > device > meg > vb_meginfo_get_sampling_frequency.m

vb_meginfo_get_sampling_frequency

PURPOSE ^

return sampling frequency from MEGinfo struct

SYNOPSIS ^

function [freq] = vb_meginfo_get_sampling_frequency(meginfo)

DESCRIPTION ^

 return sampling frequency from MEGinfo struct

 [usage]
   [freq] = vb_meginfo_get_sampling_frequency(meginfo)

 [input]
   meginfo : <required> <<struct>> MEG header information

 [output]
      freq : value of sampling frequency

 [note]
   
 [history]
   2007-08-02 (Sako) initial version

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function [freq] = vb_meginfo_get_sampling_frequency(meginfo)
0002 % return sampling frequency from MEGinfo struct
0003 %
0004 % [usage]
0005 %   [freq] = vb_meginfo_get_sampling_frequency(meginfo)
0006 %
0007 % [input]
0008 %   meginfo : <required> <<struct>> MEG header information
0009 %
0010 % [output]
0011 %      freq : value of sampling frequency
0012 %
0013 % [note]
0014 %
0015 % [history]
0016 %   2007-08-02 (Sako) initial version
0017 %
0018 % Copyright (C) 2011, ATR All Rights Reserved.
0019 % License : New BSD License(see VBMEG_LICENSE.txt)
0020 
0021 % --- CHECK ARGUMENTS --- %
0022 if ~exist('meginfo', 'var'), meginfo = []; end
0023 [meginfo] = inner_check_arguments(meginfo);
0024 
0025 % --- MAIN PROCEDURE --------------------------------------------------------- %
0026 %
0027 freq = meginfo.SampleFreq;
0028 return;
0029 %
0030 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0031 
0032 % --- INNER FUNCTIONS -------------------------------------------------------- %
0033 %
0034 function [meginfo] = inner_check_arguments(meginfo)
0035 func_ = mfilename;
0036 if isempty(meginfo)
0037   error('(%s)meginfo is a required parameter', func_);
0038 end
0039 
0040 if ~isfield(meginfo, 'SampleFreq')
0041   meginfo.SampleFreq = 0;
0042 end
0043 %
0044 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0045 
0046 % --- END OF FILE --- %

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005