Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

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

Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Steven Lord

Posts: 17,945
Registered: 12/7/04
Re: How to get the co-ordinate values from a graph automatically.
Posted: Jan 31, 2013 9:47 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Ansuman Mahapatra" <helloansuman@gmail.com> wrote in message
> 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.
> Please help me in getting the values.

Just evaluate the fit at your desired points.

>> load census;
>> 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
1800 5.3
1810 7.2
1820 9.6
*snip the rest of the table*

Steve Lord
To contact Technical Support use the Contact Us link on

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum 1994-2015. All Rights Reserved.