Function File: [fhandle, fullname] = data2fun (ti, yi)
Function File: […] = data2fun (…, property, value)

Create a vectorized function based on data samples using interpolation.

The values given in yi (N-by-k matrix) correspond to evaluations of the function y(t) at the points ti (N-by-1 matrix). The data is interpolated and the function handle to the generated interpolant is returned.

The function accepts property-value pairs described below.

file

Code is generated and .m file is created. The value contains the name of the function. The returned function handle is a handle to that file. If value is empty, then a name is automatically generated using tempname and the file is created in the current directory. value must not have an extension, since .m will be appended. Numerical values used in the function are stored in a .mat file with the same name as the function.

interp

Type of interpolation. See interp1.

See also: interp1.

Package: signal