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