I have some data and I need power fit.And display it on the graph.But I couldnt find the right codes for it.(adsbygoogle = window.adsbygoogle || []).push({}); (I need codes)

Here my graph,

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 Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# MATLAB Matlab Power Fit on Graph-Codes

Have something to add?

Draft saved
Draft deleted

**Physics Forums | Science Articles, Homework Help, Discussion**