Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

polyfit command

Status
Not open for further replies.

jom09

Mechanical
Aug 25, 2009
2
Hi guys, i am currently trying to use matlab to find an equation of a curve.

The curve is speed (x axis) Vs torque (y axis)

The cordinates for the speed are (0, 20, 40, 60, 65, 70, 75, 80, 85, 90, 95, 100)

The coordinates for the torque are (150, 176, 212, 268, 282, 282, 289, 296, 290, 262, 200, 100, 0)

What i want to do is use this information to find out the equation of this curve, preferably in the form of Torque = soem function of speed.

Any help on this would be much appreciated.

Thanks
 
Replies continue below

Recommended for you

1. Type "help polyfit"
2. Why not just use the curve fitter in Excel?

M

--
Dr Michael F Platten
 
also there is a choice fitting or generating a spline. Spline exactly matches the data, for use when piecewise solution is acceptable and you suspect no error in the data. Fit works when you have error in the data or want a simpler expression (not a piecewise expression).

=====================================
Eng-tips forums: The best place on the web for engineering discussions.
 
and in either case, your two vectors need to be the same length (yours aren't)

=====================================
Eng-tips forums: The best place on the web for engineering discussions.
 
Thanks, for that electricpete, the vecotors are meant to eb the same there was justa typo n there is an extra 282 in the torques. So how would i go about typing code into matlab to exactly match the data and get a equation?

Thanks
 
Well, the way I'd do it is to find someone who had done the turorials or was paying attention in class, and actually knew how to use matlab, and ask them to do it.

Of course I might have to pay them to do my work for me. Such is life.

Cheers

Greg Locock

SIG:please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
What Greg said. If you want the spline, look at
help spline
and
help unmkpp

=====================================
Eng-tips forums: The best place on the web for engineering discussions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor