IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
emptystruct.m
Go to the documentation of this file.
1 %>@ingroup misc
2 %>@file
3 %>@brief Creates empty structure with fields as in passed structure
4 
5 %> @param st Struct with fields to be used to create the empty struct, OR cell array of field names (as strings)
6 function out = emptystruct(st)
7 
8 if iscell(st)
9  ff = st;
10 else
11  ff = fields(st);
12 end;
13 
14 out = struct.empty();
15 for i = 1:numel(ff)
16  [out(:).(ff{i})] = deal();
17 end;
function emptystruct(in st)
Analysis Session (AS) base class.
Definition: as.m:6