- The integrand passed to integral() is not a function handle
- You have 2 unknowns in x0, but only 1 unknown in par
- You've written it in terms of par and y instead of par and x
How to solve problem with function lscuvfit, whena i have ther integral without xmax? Thank you.
1 view (last 30 days)
Show older comments
How to solve this proble please?
y= [0.871 0.928 0.946 0.952 0.958 0.965 0.971 0.979 0.987 0.992 0.995 0.997];
x=[0.2 0.5 0.7 0.8 0.9 1.1 1.5 2.3 4.6 9.2 22.9 45.9];
x0=[5 0.03];
fun=@(par,y)integral(((2-par(1))./(1-par(1)))^(5/2),0,y);
sol= lsqcurvefit(fun,x0,x,y);
The right solution of par (1) and y must be a 0.965.
0 Comments
Answers (1)
Matt J
on 10 Apr 2021
Edited: Matt J
on 10 Apr 2021
The right solution of par (1) and y must be a 0.965.
Why do you speak of y as if it is an unknown? The unknown parameters are supposed to be the vector elements par(i). Also. your model fun(par,y) doesn't look right for several reasons,
Also note that if the integrand is intended to be a par-dependent constant, you can do the integral analytically. You don't need the integral() coommand.
See Also
Categories
Find more on Ordinary Differential Equations 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!