how to create curve non linear

2 visualizaciones (últimos 30 días)
uncung fgv
uncung fgv el 26 de Mzo. de 2012
i want to perform curve at range:
y= from 7 to 9
x= from 2.5 to 3.0
the curve is not linear.

Respuestas (1)

Kye Taylor
Kye Taylor el 26 de Mzo. de 2012
Not sure I entirely understand your question, but if you're trying to create a nonlinear curve that passes through the two points (2.5,7) and (3,9), you can create a piecewise linear function:
7 if x<2.75
f(x) =
9 if x>=2.75
Or, if you need continuity and differentiability, you can use the equation of a parabola
y(x) = a*x^2+b*x + c
Substituting x = 2.5, y = 7 yields
7 = 6.25*a + 2.5*b + c
Similarly, substituting x = 3, y = 9 yields
9 = 9*a + 3*b + c
This underdetermined system (with unknowns a,b, and c) is consistent and therefore has infintely many solutions. If c = free parameter (t), then a family of parabolas that pass through (2.5,7) and (3,9) is given by
y(x) = (2/15*t + 2/5)*x^2
+ (-11/15*t + 9/5)*x
+ t
For example, if t = 0,
y(x) = 2/5*x^2 + 9/5*x
is a nonlinear curve through the points (2.5,7),(3,9);

Categorías

Más información sobre Linear and Nonlinear Regression en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by