Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: How to get the co-ordinate values from a graph automatically.
Replies: 2   Last Post: Feb 1, 2013 12:47 AM

 Messages: [ Previous | Next ]
 Steven Lord Posts: 17,965 Registered: 12/7/04
Re: How to get the co-ordinate values from a graph automatically.
Posted: Jan 31, 2013 9:47 AM

"Ansuman Mahapatra" <helloansuman@gmail.com> wrote in message
news:ked472\$7l5\$1@newscl01ah.mathworks.com...
> I have a roughly Gaussian dataset & I use curve fitting to fit that data
> to a Gaussian curve using "fit(xx',n1(4,:)','gauss2')". Problem is that I
> want to know each data points in that fitted curve without clicking on the
> graph or plotting it on a graph.
>

Just evaluate the fit at your desired points.

>> curve = fit(cdate, pop, 'poly2')

curve =
Linear model Poly2:
curve(x) = p1*x^2 + p2*x + p3
Coefficients (with 95% confidence bounds):
p1 = 0.006541 (0.006124, 0.006958)
p2 = -23.51 (-25.09, -21.93)
p3 = 2.113e+04 (1.964e+04, 2.262e+04)
>> [cdate pop curve(cdate)]
ans =
1790 3.9
5.58300395258266
1800 5.3
5.31212874083576
1810 7.2
6.34947962793376
1820 9.6
8.69505661387666
*snip the rest of the table*

--
Steve Lord
slord@mathworks.com