2 % Check cell array X of size 3 with x,y,z coordinates for correct dimensions
3 % and positive increments
4 % This does not check for increments to be equal in any way
6 x = X{1}; y = X{2}; z = X{3};
7 if ndims(x)~=3|ndims(y)~=3|ndims(z)~=3,
8 error('test_mesh: x y z must be 3D')
11 [nx1,ny1,nz1] = size(x);
12 if any(size(y)~=[nx1,ny1,nz1])|any(size(z)~=[nx1,ny1,nz1]),
13 error('check_mesh: arrays x y z must be the same size')
15 if ~all(all((x(2:end,:,:)>x(1:end-1,:,:)))),
16 error('check_mesh: x increments in array x must be positive')
18 if ~all(all((y(:,2:end,:)>y(:,1:end-1,:)))),
19 error('check_mesh: y increments in array y must be positive')
21 if ~all(all((z(:,:,2:end)>z(:,:,1:end-1)))),
22 error('check_mesh: z increments in array z must be positive')