MatLab fiting eqaution to data

  • Thread starter 2slowtogofast
  • Start date
  • Tags
    Data Matlab
In summary, to solve for an expression of x*y^a = b and b are constants, you can use the curve fitting toolbox to fit a straight line to your data and then manipulate the equation algebraically to solve for the coefficients. Another option is to use the polyfit function to fit a polynomial equation to your data.
  • #1
2slowtogofast
135
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
  • #2
You may want to investigate the curve fitting toolbox

http://www.mathworks.com/products/curvefitting/description1.html
 
Last edited by a moderator:
  • #3
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.
 
  • #4
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.
 
  • #5


First, it is important to understand the goal of fitting an equation to a data set. The purpose is to find an equation that best represents the relationship between the x and y values in the data set. In this case, we are looking for an equation of the form x*y^a = b, where a and b are constants.

To get started, you can use the curve fitting tool in MatLab. This tool allows you to easily fit an equation to your data set by selecting the appropriate function and adjusting the parameters to find the best fit. You can also use the "fit" function in MatLab, which allows you to specify the type of equation you want to fit and the data set.

It is important to note that there is no one "correct" equation to fit to a data set. The choice of equation will depend on the nature of the data and the relationship between the variables. It may be helpful to plot the data first to get an idea of the general shape and trend before attempting to fit an equation.

Additionally, it is important to consider the accuracy and validity of the equation you are fitting. The fit may look good visually, but it is important to also assess the statistical significance of the fit and any potential errors or limitations in the data.

In summary, to fit an equation to a data set in MatLab, you can use the curve fitting tool or the "fit" function, but it is important to carefully consider the nature of the data and the validity of the fit.
 

What is MatLab fitting equation to data?

MatLab fitting equation to data is a process in which MatLab is used to find the best fit equation for a set of data points. This involves finding a mathematical equation that describes the relationship between the independent and dependent variables in the data.

What is the purpose of using MatLab to fit equations to data?

The purpose of using MatLab to fit equations to data is to analyze and model the relationships between variables in a dataset. This can help in making predictions, understanding patterns, and gaining insights from the data.

What types of equations can be fitted to data using MatLab?

MatLab can fit a wide range of equations to data, including linear, polynomial, exponential, logarithmic, power, and custom equations. It also allows for multiple independent variables and can handle large datasets.

How does MatLab fit equations to data?

MatLab uses various numerical methods, such as least-squares regression, to fit equations to data. These methods involve minimizing the sum of the squared differences between the data points and the fitted curve. MatLab also allows for adjusting parameters and constraints to improve the fit.

Can MatLab handle noisy or missing data when fitting equations?

Yes, MatLab has built-in functions for handling noisy or missing data when fitting equations. These include data smoothing techniques and interpolation methods to estimate missing data points. MatLab also allows for data preprocessing to improve the accuracy of the fitted equation.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
7
Views
990
  • Engineering and Comp Sci Homework Help
Replies
3
Views
809
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
945
  • Engineering and Comp Sci Homework Help
Replies
9
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
882
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
888
Back
Top