load current type USAGE: [curr_type, file_type] = vb_load_current_type(currfile) --- INPUT: currfile - current file name --- OUTPUT: curr_type - current type = 0 : J-current : original vertex current [Default] = 1 : Z-current : internal current correspond to locally spread source file_type : file type file_type = 0: single file file_type = 1: parent file with trial files --- History 2009-07-30 Taku Yoshioka Previous version did not check if 'jactdir' is empty or not. Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function [curr_type, file_type] = vb_load_current_type(currfile) 0002 % load current type 0003 % 0004 % USAGE: 0005 % [curr_type, file_type] = vb_load_current_type(currfile) 0006 % 0007 % --- INPUT: 0008 % currfile - current file name 0009 % --- OUTPUT: 0010 % curr_type - current type 0011 % = 0 : J-current : original vertex current [Default] 0012 % = 1 : Z-current : internal current 0013 % correspond to locally spread source 0014 % file_type : file type 0015 % file_type = 0: single file 0016 % file_type = 1: parent file with trial files 0017 % 0018 % --- History 0019 % 2009-07-30 Taku Yoshioka 0020 % Previous version did not check if 'jactdir' is empty or not. 0021 % 0022 % Copyright (C) 2011, ATR All Rights Reserved. 0023 % License : New BSD License(see VBMEG_LICENSE.txt) 0024 0025 load(currfile) 0026 0027 if exist('Zact','var') 0028 curr_type = 1; 0029 if isfield(Jinfo,'jactdir') & ~isempty(Jinfo.jactdir), 0030 file_type = 1; 0031 else 0032 file_type = 0; 0033 end 0034 0035 elseif exist('Jact','var') 0036 curr_type = 0; 0037 if exist('JactInfo','var') 0038 file_type = 1; 0039 else 0040 file_type = 0; 0041 end 0042 elseif exist('J','var') 0043 curr_type = 0; 0044 file_type = 0; 0045 else 0046 curr_type = ''; 0047 file_type = ''; 0048 end 0049 0050 0051 return