how to create curve non linear

조회 수: 1 (최근 30일)
uncung fgv
uncung fgv 2012년 3월 26일
i want to perform curve at range:
y= from 7 to 9
x= from 2.5 to 3.0
the curve is not linear.

답변 (1개)

Kye Taylor
Kye Taylor 2012년 3월 26일
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);

카테고리

Help CenterFile Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by