IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
setbatch.m
Go to the documentation of this file.
1 %> @file
2 %> @ingroup misc
3 %> @brief Assigns several fields to structure or object.
4 %
5 %> @param params Cell followint the pattern @verbatim {'property1', value1, 'property2', value2, ...} @endverbatim
6 function o = setbatch(o, params)
7 for i = 1:length(params)/2
8  varname = params{i*2-1};
9  value = params{i*2};
10  o.(varname) = value;
11 end;
12 
function setbatch(in o, in params)