add item to history. [USAGE] [obj] = history_add_history(<obj>, <description>[ ,parm]); [IN] obj : history object description : <<string>> explanation of history parm : <<structure>> parameter [OUT] obj : history object Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function [obj] = history_add_item(obj, description, parm) 0002 % add item to history. 0003 % [USAGE] 0004 % [obj] = history_add_history(<obj>, <description>[ ,parm]); 0005 % [IN] 0006 % obj : history object 0007 % description : <<string>> explanation of history 0008 % parm : <<structure>> parameter 0009 % [OUT] 0010 % obj : history object 0011 % 0012 % Copyright (C) 2011, ATR All Rights Reserved. 0013 % License : New BSD License(see VBMEG_LICENSE.txt) 0014 0015 % 0016 % --- Previous check 0017 % 0018 if ~exist('obj', 'var'), error('obj is a required parameter.'); end 0019 if ~exist('description', 'var') 0020 error('description is a required parameter.'); 0021 end 0022 if ~exist('parm', 'var') 0023 parm = []; 0024 end 0025 0026 0027 % 0028 % --- Main Procedure 0029 % 0030 Nitem = history_get_length(obj); 0031 item = struct; 0032 item.description = description; 0033 item.parm = parm; 0034 obj.item_list{Nitem+1} = item; 0035 0036 % 0037 % --- After check 0038 % 0039 if nargout ~= 1 0040 error('function caller should receive obj.'); 0041 end