Home > functions > common > utility > vb_key_value_pair.m

vb_key_value_pair

PURPOSE ^

create data set for table

SYNOPSIS ^

function [set] = vb_key_value_pair(key, value)

DESCRIPTION ^

 create data set for table
 [USAGE]
    [set] = vb_key_value_pair(key, value);
 [IN]
      key : data key for search value  [string]
    value : Any type of data which you want.
 [OUT]
    set : data set for table <<struct>>

 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:

SOURCE CODE ^

0001 function [set] = vb_key_value_pair(key, value)
0002 % create data set for table
0003 % [USAGE]
0004 %    [set] = vb_key_value_pair(key, value);
0005 % [IN]
0006 %      key : data key for search value  [string]
0007 %    value : Any type of data which you want.
0008 % [OUT]
0009 %    set : data set for table <<struct>>
0010 %
0011 % Copyright (C) 2011, ATR All Rights Reserved.
0012 % License : New BSD License(see VBMEG_LICENSE.txt)
0013 
0014 %
0015 % --- Previous check
0016 %
0017 if nargin < 2
0018     error('vb_key_value_pair requires 2 parameters.');
0019 end
0020 if ~ischar(key)
0021     error('key value must be string.');
0022 end
0023 
0024 set = struct;
0025 set.key = key;
0026 set.value = value;

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005