2-D interpolation with option for hard limit on the dimensions.
function interpolate2D input Real x[:] "x-abscissa table vector (strict monotonically increasing values required)"; input Real y[:] "y-abscissa table vector (strict monotonically increasing values required)"; input Real data[size(x, 1), size(y, 1)] "Ordinate data table with size(x) rows and size(y) columns"; input Real xi "Desired x-abscissa value"; input Real yi "Desired y-abscissa value"; input Boolean useBound = false "= true then value outside bounds are constant"; output Real val "Ordinate value corresponding to (xi,yi)"; output Real[size(x, 1)] temp; end interpolate2D;