convert a data to a function

21 views (last 30 days)
JEDIDI Ran
JEDIDI Ran on 3 Jun 2020
Commented: JEDIDI Ran on 5 Jun 2020
Hi, i have currently received a data ( table of points (xi, yi)
and i want to convert it even approximatively to a function
is that possible with matlab ?
need help!
  2 Comments
madhan ravi
madhan ravi on 3 Jun 2020
Are you talking about fitting ?
JEDIDI Ran
JEDIDI Ran on 3 Jun 2020
i have number of point (x,y) like that , and i want to turn it as function y=f(x) (get it expression) the closet function to the plot
2.07E+00 0.45
2.07E+00 1.37
2.07E+00 2.33
2.07E+00 3.36
2.07E+00 4.45
2.07E+00 5.59
2.07E+00 6.8
2.08E+00 8.07
2.08E+00 9.4
2.08E+00 10.8
2.08E+00 12.29
2.08E+00 13.8

Sign in to comment.

Answers (1)

madhan ravi
madhan ravi on 3 Jun 2020
  2 Comments
JEDIDI Ran
JEDIDI Ran on 5 Jun 2020
i have used polyfit function to do so and i have got that plot the red one is the polyfit function , the blue is the one i have it data , as you see they are close to each other but
P(t)= =2.995134969444502*(10^3)*(t^10)+(2.454194242827056*(10^3))*(t^9)-(3.074449680687996*(10^4))*(t^8)-(1.831814183200164*(10^4))*(t^7)+(1.225116448716314*(10^5))*(t^6)+(1.225116448716314*(10^5))*(t^5)-(2.265044070414277*(10^5))*(t^4)+(6.259310423328208*(10^2))*(t^3)+(1.720638633336634*(10^5))*(t^2)+(8.587517861009773*(10^4))*t+(2.102731998692876*(10^5));
so P(t=0)= (2.102731998692876*(10^5)) different from zero
what should i do to make it close ?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!