![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/200831/image.png)
How can I build power function through point?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Irene Dzhavadova
el 15 de En. de 2019
Comentada: Irene Dzhavadova
el 16 de En. de 2019
Please, help me! I have the coordinates of the curve y = [150 150 130 130 130 100 100 100 80 80 80 60], x = [52000 70000 74000 96000 100000 170000 220000 245000 530000 720000 810000 4900000]. This curve well described by power function. How can I build the same curve passing through the point A(68856, 210) and get it equation?
6 comentarios
Torsten
el 16 de En. de 2019
If points are added, you will have to fit your model again. As a result, you'll get different values for a, b and c.
Respuesta aceptada
Sayyed Ahmad
el 16 de En. de 2019
I would do something like this:
x = [52000 70000 74000 96000 100000 170000 220000 245000 530000 720000 810000 4900000];
y = [150 150 130 130 130 100 100 100 80 80 80 60];
p=polyfit(log(x),sqrt(y),2)
x1=linspace(min(x),max(x),100);
y1=polyval(p,log(x1)).^2;
plot(x,y,'r*',x1,y1,'b-')
I hope that is waht you looking for.
![Poly.JPG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/200839/Poly.jpeg)
3 comentarios
Sayyed Ahmad
el 16 de En. de 2019
Editada: Sayyed Ahmad
el 16 de En. de 2019
you can shift it.
y(a)-(y1)=dy
y=f(x)+dy
but you could be only met one point. But If you do that, the deviation will increase. I don't want to recomend you this way.
I don't know what is the aim of this calculation. I will try to reduce the standard diviation with changing in the value n in polyfit.
p=polyfit(x,y,n)
n could be 1, 2, 3, 4, 5 and so on.
Try to change them to find out your acceptable p.
x = [52000 70000 74000 96000 100000 170000 220000 245000 530000 720000 810000 4900000];
y = [150 150 130 130 130 100 100 100 80 80 80 60];
for i=1:5
p=polyfit(log(x),sqrt(y),i)
x1=linspace(min(x),max(x),100);
y1=polyval(p,log(x1)).^2;
plot(x,y,'r*',x1,y1,'-')
hold on
end
![Poly.JPG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/200842/Poly.jpeg)
Más respuestas (0)
Ver también
Categorías
Más información sobre Interpolation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!