-
Notifications
You must be signed in to change notification settings - Fork 185
/
cat.m
30 lines (24 loc) · 859 Bytes
/
cat.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function grains = cat(~,varargin)
% implements [grain1, grain2]
%
% Syntax
% g = [grains_1, grains_2, grains_n]
% g = [grains('fe') grains('mg')]
% g = [grains(1:100) grains(500:end)]
%
% See also
% grain2d/vertcat
grains = cat@dynProp(1,varargin{:});
for k = 2:numel(varargin)
ng = varargin{k};
if isempty(ng), continue; end
grains.id = [grains.id; ng.id];
grains.phaseId = [grains.phaseId; ng.phaseId];
grains.grainSize = [grains.grainSize; ng.grainSize];
grains.poly = [grains.poly; ng.poly];
grains.inclusionId = [grains.inclusionId; ng.inclusionId];
grains.boundary = [grains.boundary; ng.boundary];
grains.innerBoundary = [grains.innerBoundary; ng.innerBoundary];
assert(angle(ng.N, grains.N,'antipodal')<1e-5,...
'Concatenating grains with different normals is not supported');
end