Skip to content
Snippets Groups Projects
Commit 9356a89b authored by William Lövfors's avatar William Lövfors
Browse files

added StructFieldCat

parent d6472c63
Branches
No related tags found
No related merge requests found
function S = StructFieldCat(S, T, dim)
if nargin<3 || isempty(dim)
dim=1;
end
for i=1:size(T,2)
fields = fieldnames(S);
for k = 1:numel(fields)
aField = fields{k}; % EDIT: changed to {}
S.(aField) = cat(dim, S.(aField), T(i).(aField));
end
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment