adding constaints to fmincon code
4 views (last 30 days)
Show older comments
fima v on 11 Feb 2022
Answered: Steven Lord on 11 Feb 2022
hello,i have wrote the following code for optimization.
how do i add the following constraints that my fmincon will run so that
clear all; close all; clc
xm = [18.3447,79.86538,85.09788,10.5211,44.4556, ...
ym = [5.072,7.1588,7.263,4.255,6.282, ...
p0 = [1,1,1];
yp = @(p) p(1) + p(2)./xm + p(3).*log(xm);
objective = @(p) sum(((yp(p)-ym)./ym).^2);
popt = fmincon(objective,p0);
Steven Lord on 11 Feb 2022
See the description of the lb and ub input arguments and the "Minimize with Bound Constraints" example on the documentation page for fmincon
More Answers (0)
Find more on Solver Outputs and Iterative Display 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!