fitting a curve to data
1 view (last 30 days)
Show older comments
Can anyone tell me what mistake I am making here? Can you please suggest any changes which make this code work? Thank you.
0 Comments
Accepted Answer
Star Strider
on 6 Oct 2014
Objective functions for lsqcurvefit and nlinfit have to have the parameter argument as the first argument and the dependent variable as the second argument.
This should work:
fun = @(x,xdata) x(1).*sin((x(2).*xdata)+x(3)); %function handle for approx curve
0 Comments
More Answers (0)
See Also
Categories
Find more on Least Squares 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!