Saving an interpolated function to an m-file
Mostrar comentarios más antiguos
I have some complicated function that I have interpolated using interp1() so that evaluating it is much faster. I would like the result of this interpolation to be available systemwide by saving it as a function in an .m-file. An example:
xd = -1:0.01:1;
yd = xd.^2;
f = @(x) interp(xd, yd, x);
Is there a way to save the result f to f.m such that I can evaluate f(x) anywhere?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Interpolation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!