PP form for the reverse function (not inverse function)

1 ビュー (過去 30 日間)
Mohammad Shojaei Arani
Mohammad Shojaei Arani 2022 年 2 月 17 日
Hello friends!
Consider a pp form for a set of (x,y) data points. Imagine now that we wish to find the pp form for the (x,1/y) data
points using the pp form for the (x,y) data. I am wondering whether matlab has a function which can calculate this?
Of course, I can simply calculate it indirectly but I am not sure if this is the best way to perform such a calculation
in terms of both speed and acuracy. For instance, the following do the job for the function cos(x) over [-pi/2 pi/2]:
x=-pi:0.5:pi/2;
y=cos(x);
pp=spline(x,y);
mesh=linspace(x(1),x(end),200);
pp_inv=spline(mesh,1./ppval(pp,mesh));
I seriously doubt whther my approach is efficient? (I feel not)
Any idea?
Thanks in advance!
Babak

回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by