Home > vbmeg > functions > device > vb_loadspec_get_channel_name.m

vb_loadspec_get_channel_name

PURPOSE ^

<<getter>> channel name in LoadSpec

SYNOPSIS ^

function [ch_name] = vb_loadspec_get_channel_name(loadspec)

DESCRIPTION ^

 <<getter>> channel name in LoadSpec
 [usage]
   [ch_name] = vb_loadspec_get_channel_name(loadspec)
 [input]
   loadspec : <required> <<struct>> LoadSpec
 [output]
    ch_name : channel name value of LoadSpec
 [note]
   if there is not a channel name field in loadspec, return ''
 [history]
   2008-02-21 (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 [ch_name] = vb_loadspec_get_channel_name(loadspec)
0002 % <<getter>> channel name in LoadSpec
0003 % [usage]
0004 %   [ch_name] = vb_loadspec_get_channel_name(loadspec)
0005 % [input]
0006 %   loadspec : <required> <<struct>> LoadSpec
0007 % [output]
0008 %    ch_name : channel name value of LoadSpec
0009 % [note]
0010 %   if there is not a channel name field in loadspec, return ''
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 ch_name = loadspec.ChannelName;
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, 'ChannelName')
0039   loadspec.ChannelName = 0;
0040 end
0041 return;
0042 %
0043 % --- end of inner_check_arguments()
0044 %
0045 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0046 
0047 %%% END OF FILE %%%

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