Matlab Custom Eq in Curve Fitting Toolbox

1 view (last 30 days)
Andrew
Andrew on 15 Jul 2015
I have a data set I'm trying to fit to the equation
However, the resulting plot does not follow the data trend at all.
ft = fittype( '(((a^2)*cosd(x)-sqrt(a^2-(sind(x)).^2))./((a^2)*cosd(x)+sqrt(a^2-(sind(x)).^2))).^2', 'independent', 'x', 'dependent', 'y' );
opts = fitoptions( 'Method', 'NonlinearLeastSquares' );
opts.Lower = 1;
opts.StartPoint = .9;
opts.Upper = 5;
The resulting fit looks like this:
How can I get the fit to accurately follow the data line?
Thanks!

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!