MATLAB Matlab Power Fit on Graph-Codes

  • Thread starter Thread starter Arman777
  • Start date Start date
  • Tags Tags
    Fit Matlab Power
AI Thread Summary
The discussion revolves around the need for power fitting data and displaying it on a graph using MATLAB. The user has provided their graphing code but encounters an error when trying to use the 'fit' function for power fitting, indicating that the function is undefined for the input type. It is clarified that the 'fit' function is part of the Curve Fitting Toolbox, which the user does not have. Participants note that while there are fitting functions available in MATLAB, the specific power fitting function is not included in the base MATLAB installation, leading to the conclusion that access to the Curve Fitting Toolbox is necessary to proceed with the desired analysis.
Arman777
Insights Author
Gold Member
Messages
2,163
Reaction score
191
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
Dr Transport said:
do you have the curve fit toolbox?
Nope sadly
 
I think fit is a part of the toolbox and not part of MATLAB in general...
 
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.
 

Similar threads

Replies
2
Views
8K
Replies
5
Views
2K
Replies
8
Views
2K
Replies
2
Views
3K
Replies
5
Views
2K
Replies
5
Views
3K
Replies
9
Views
5K
Back
Top