From b44f8de350c700294d813622a9b5e079b64d383f Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Fri, 20 Dec 2013 10:02:48 +0100 Subject: [PATCH] matlab: allow empty number of lines for 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 b88c58e..6682a83 100644 --- a/matlab/GetField_Interpolation.m +++ b/matlab/GetField_Interpolation.m @@ -35,9 +35,21 @@ y = mesh.lines{2}; z = mesh.lines{3}; if (isnumeric(lines)) - x_i = linspace(x(1),x(end),lines(1)); - y_i = linspace(y(1),y(end),lines(2)); - z_i = linspace(z(1),z(end),lines(3)); + if (lines(1)==0) + x_i = x; + else + x_i = linspace(x(1),x(end),lines(1)); + end + if (lines(2)==0) + y_i = y; + else + y_i = linspace(y(1),y(end),lines(2)); + end + if (lines(3)==0) + z_i = z; + else + z_i = linspace(z(1),z(end),lines(3)); + end else if isempty(lines{1}) x_i = x;