finding point on a function

4 次查看(过去 30 天)
Jiung Shin
Jiung Shin 2020-12-9
I have a function P using polyfit. How can I find the corrdinate on P when x=a?

回答(2 个)

Ameer Hamza
Ameer Hamza 2020-12-9
You can use polyval()
xv; % x data-points
yv; % y data-points
p = polyfit(xv, yv, 3);
x = a;
y = polyval(p, x);

KSSV
KSSV 2020-12-9
Read about interp1.
Let (x,y) be your data.
xi = a ;
yi = interp1(x,y,xi) ;
[xi yi]

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by