How Do I Fit the Equation x*y^a = b to Data in MatLab?

  • Thread starter Thread starter 2slowtogofast
  • Start date Start date
  • Tags Tags
    Data Matlab
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
3 replies · 2K views
2slowtogofast
Messages
134
Reaction score
1
if i am given a data set of x and y values i need to come up with an expression of

x*y^a = b and b are constants

no idea how to get started any help geting started please
 
Physics news on Phys.org
You may want to investigate the curve fitting toolbox

http://www.mathworks.com/products/curvefitting/description1.html
 
Last edited by a moderator:
yeah i did polyfit(x,log(y),1)

that will return 2 number and ill have an eqn

lny = a1x+a2 it fit a straight line to my data but I am confused on what to do next i need xy^a = b is there another function i should try and use or is this more of an algebraic manipulation type of thing and if so can some one tell me where to start.
 
There is an algebraic way to solve that. Here is my approach

[tex]y^a = \frac{b}{x}[/tex]

[tex]\log(y^a) = \log(\frac{b}{x})[/tex]

[tex]a \log(y) = \log(b) - \log(x)[/tex]

Since this is the homework forum I can't solve the entire problem for you. However, if you do some arranging you can do a [tex]y=mx+b[/tex] curve fit and solve for your coefficients.