Matlab Custom Eq in Curve Fitting Toolbox
1 view (last 30 days)
Show older comments
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!
0 Comments
Answers (0)
See Also
Categories
Find more on Linear and Nonlinear Regression in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!