From f1b2a94633790f75561a5ab73eb3093a4d8ecaed Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Thu, 15 Aug 2013 16:47:44 +0200 Subject: [PATCH] matlab: allow empty directions in field interpolation Signed-off-by: Thorsten Liebig --- matlab/GetField_Interpolation.m | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/matlab/GetField_Interpolation.m b/matlab/GetField_Interpolation.m index fd377e2..61d143e 100644 --- a/matlab/GetField_Interpolation.m +++ b/matlab/GetField_Interpolation.m @@ -39,9 +39,21 @@ if (isnumeric(lines)) y_i = linspace(y(1),y(end),lines(2)); z_i = linspace(z(1),z(end),lines(3)); else - x_i = lines{1}; - y_i = lines{2}; - z_i = lines{3}; + if isempty(lines{1}) + x_i = x; + else + x_i = lines{1}; + end + if isempty(lines{2}) + y_i = y; + else + y_i = lines{2}; + end + if isempty(lines{3}) + z_i = z; + else + z_i = lines{3}; + end end field_i = field;