Matlab Power Fit on Graph-Codes

  • Context: MATLAB 
  • Thread starter Thread starter Arman777
  • Start date Start date
  • Tags Tags
    Fit Matlab Power
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 2K views
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
 
on Phys.org
Dr Transport said:
I think fit is a part of the toolbox and not part of MATLAB in general...
there's fit things but not power fit.