analc_endsversion/FittingAndMath/CatStructFields.m

6 lines
188 B
Mathematica
Raw Normal View History

2022-04-11 13:28:22 +00:00
function S = CatStructFields(S, T, dim)
fields = fieldnames(S);
for k = 1:numel(fields)
aField = fields{k}; % EDIT: changed to {}
S.(aField) = cat(dim, S.(aField), T.(aField));
end