analc_endsversion/FittingAndMath/CatStructFields.m
2022-04-11 15:28:22 +02:00

6 lines
No EOL
188 B
Matlab

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