MatrixBerryCore
unionstructsalongdim.m
Go to the documentation of this file.
1 function NewStruct = unionstructsalongdim(catDimension, varargin)
2 isEmp=cellfun('isempty',varargin);
3 varargin=varargin(~isEmp);
4 nArg=numel(varargin);
5 switch nArg
6  case 0
7  NewStruct=struct;
8  case 1
9  NewStruct=varargin{1};
10  otherwise
11  NewStruct=varargin{1};
12  for iArg=2:nArg
13  NewStruct=mxberry.core.struct.binaryunionstruct(NewStruct,...
14  varargin{iArg},@(x,y)cat(catDimension,x,y),@(x) x,@(x)x);
15  end
16 end
function unionstructsalongdim(in catDimension, in varargin)
UNIONSTRUCTS unites structures with the same fields by concatenating the corresponding fields along t...
function cat(in dimNum, in varargin)