Info
This question is closed. Reopen it to edit or answer.
In the code if i am changing the power of xdata from 0.1 to 0.9 i am getting same coefficient values 0.2000 10.00 10.00 of x1,x2 and x3. please suggest me what changes are required???
1 view (last 30 days)
Show older comments
xdata =[10.^(-3) 10.^(-2) 10.^(-1) 1 10.^(1) 10.^(2)]; ydata=(0.5012./(xdata.^2+1.8*xdata+2.2 )); fun=@(x)sum(x(1)./((x(2).*xdata.^1.1+x(3).*xdata.^0.1+1)- ydata).^2); options = optimoptions('particleswarm','SwarmSize',100,'HybridFcn',@fmincon); rng default % For reproducibility nvars = 3; LB = [0.2;0.2; 0.2]; UB = [10; 10; 10]; [x] = particleswarm(fun,nvars,LB,UB,options)
0 Comments
Answers (0)
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!