From ef8ef75032863ab812a56ba647097592ac876f8e Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Wed, 18 Jul 2012 16:03:27 +0200 Subject: [PATCH] Matlab: AddPML allow single value for all directions Signed-off-by: Thorsten Liebig --- matlab/AddPML.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/matlab/AddPML.m b/matlab/AddPML.m index 630353b..251417c 100644 --- a/matlab/AddPML.m +++ b/matlab/AddPML.m @@ -27,6 +27,10 @@ function mesh = AddPML( mesh, numcells, CoordSystem ) % check error( nargchk(2,3,nargin) ); +if (numel(numcells)==1) + numcells = ones(6,1)*numcells; +end + numcells = reshape( numcells, 1, [] ); if numel(numcells) ~= 6 error( 'argument numcells needs to have exactly 6 elements' );