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
AI Thread Summary
To fit the equation x*y^a = b to a dataset in MATLAB, start by using the curve fitting toolbox. The initial approach involves transforming the equation into a logarithmic form, leading to a linear relationship: a*log(y) = log(b) - log(x). This allows for the use of polyfit to obtain coefficients for a linear fit. After obtaining the coefficients, rearranging the terms will help derive the desired expression. Algebraic manipulation is essential for solving the equation effectively.
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

y^a = \frac{b}{x}

\log(y^a) = \log(\frac{b}{x})

a \log(y) = \log(b) - \log(x)

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 y=mx+b curve fit and solve for your coefficients.
 
Back
Top