Matlab Power Fit on Graph-Codes

In summary, the conversation is about the speaker trying to find the right codes to create a power fit graph using their data. They mention using the fit function, but it does not work because they do not have the curve fit toolbox.
  • #1
Arman777
Insights Author
Gold Member
2,168
193
I have some data and I need power fit.And display it on the graph.But I couldn't find the right codes for it.(I need codes)
Here my graph,

Part A.png


Here my codes,
>> x=BN(:,2);
>> B=BN(:,1);
>> plot(x,B,'go')
>> plot(x,B,'go')
>> hold on
>> xlabel('Distance (m)','Fontsize',21);
>> ylabel('Magnetic Field Strength (T)','Fontsize',21)
>> title('B vs x,Part (A)','Fontsize',23)
>> grid on
>>

I tried ,
>> f = fit(x,B,'power1')
but says,
Undefined function 'fit' for input arguments of type 'double'.

Thanks
 
Physics news on Phys.org
  • #3
Dr Transport said:
do you have the curve fit toolbox?
Nope sadly
 
  • #4
I think fit is a part of the toolbox and not part of MATLAB in general...
 
  • #5
Dr Transport said:
I think fit is a part of the toolbox and not part of MATLAB in general...
Theres fit things but not power fit.
 

1. What is Matlab Power Fit on Graph-Codes?

Matlab Power Fit on Graph-Codes is a method used in Matlab to fit a power equation to a set of data points on a graph. It involves finding the best values for the coefficients in the power equation that will accurately represent the relationship between the variables in the data.

2. How is the power equation calculated in Matlab Power Fit on Graph-Codes?

The power equation in Matlab Power Fit on Graph-Codes is calculated using the least squares method. This involves minimizing the sum of the squared differences between the data points and the predicted values from the power equation.

3. What types of data can be used in Matlab Power Fit on Graph-Codes?

Matlab Power Fit on Graph-Codes can be used with any type of data that follows a power relationship, such as exponential or polynomial data. It is commonly used in scientific and engineering fields to analyze and model data.

4. How accurate is the power fit method in Matlab?

The accuracy of the power fit method in Matlab depends on the quality of the data and the number of data points. Generally, the more data points there are, the more accurate the fit will be. However, it is important to note that the power fit method is an estimation and may not perfectly represent the relationship between the variables.

5. Can Matlab Power Fit on Graph-Codes be used for nonlinear data?

Yes, Matlab Power Fit on Graph-Codes can be used for nonlinear data as long as the data follows a power relationship. However, if the data does not follow a power relationship, a different method such as curve fitting may be more appropriate.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
8K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
14
Views
2K
Back
Top