MATLAB -- how to create a parabolic arc?
Afficher commentaires plus anciens
Example, I have three points x1, x2, and x3.
x1 is the start point of the arc; x3 is the end point of the arc; x2 is the critical point of the arc (where the tangent slope is zero).
If x2<x1, then the arc is a U-shaped (smiley); If x2>x1, then the arc is a upside-down-U-shaped (upside smiley).
Any ideas?
1 commentaire
Youssef Khmou
le 15 Avr 2013
Modifié(e) : Youssef Khmou
le 15 Avr 2013
that condition is done automatically by the equation ax²+bx+c
Réponse acceptée
Plus de réponses (3)
This is a simple polynomial curve fit problem. If you have the curve fitting toolbox, the problem is solved by:
x = [0 5 10];
y = [0 5 0];
fit(x,y,'poly2');
This will give the coefficients for the second order polynomial. With only 3 point, the fitted curve will pass exactly through all three points. This function will work for any three points, as long as they are no colinear.
If you do not have the curve fitting toolbox, its not too hard to build a function which will perform polynomial curve fitting. If you are interested, I will help you work out the equations.
Vetrivel
le 30 Août 2022
0 votes
x = [0 5 10];
y = [0 5 0];
fit(x,y,'poly2');
Melek Cavlak
le 4 Déc 2022
0 votes
x = [0 5 10];
y = [0 5 0];
fit(x,y,'poly2');
Catégories
En savoir plus sur Data Distribution Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!