Home > vbmeg > functions > leadfield > head > vb_head_load_vhead.m

vb_head_load_vhead

PURPOSE ^

Vhead loader from head file

SYNOPSIS ^

function [retval] = vb_head_load_vhead(head_file)

DESCRIPTION ^

 Vhead loader from head file
 [usage]
   [retval] = vb_head_load_vhead(head_file)
 [input]
   head_file : <required> head file (accessible path)
 [output]
      retval : loaded data
 [note]
   if cannot find Vhead field, return empty
 [history]
   2007-04-10 (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 [retval] = vb_head_load_vhead(head_file)
0002 % Vhead loader from head file
0003 % [usage]
0004 %   [retval] = vb_head_load_vhead(head_file)
0005 % [input]
0006 %   head_file : <required> head file (accessible path)
0007 % [output]
0008 %      retval : loaded data
0009 % [note]
0010 %   if cannot find Vhead field, return empty
0011 % [history]
0012 %   2007-04-10 (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('head_file', 'var') head_file = []; end;
0019 [head_file] = inner_check_arguments(head_file);
0020 
0021 % --- MAIN PROCEDURE --------------------------------------------------------- %
0022 %
0023 retval = [];
0024 load(head_file, 'Vhead');
0025 if exist('Vhead', 'var')
0026   retval = Vhead;
0027 end
0028 %
0029 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0030 
0031 % --- INNER FUNCTIONS -------------------------------------------------------- %
0032 %
0033 function [head_file] = inner_check_arguments(head_file)
0034 if isempty(head_file)
0035   error('head_file is a required parameter');
0036 end
0037 
0038 if exist(head_file, 'file') ~= 2
0039   error('cannot read head_file : %s', head_file);
0040 end
0041 %
0042 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0043 
0044 %%% END OF FILE %%%

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