Info

此问题已关闭。 请重新打开它进行编辑或回答。

Empty plot: I need to plot one variable vs Results of fmincon

1 次查看(过去 30 天)
clc
d0 = 0.01:1;
Xmat = zeros(numel(d0),5);
for i=1:numel(d0)
d0_actual = Ef(i);
x0 = [0.08, 9.14, 10, 1, 0.1];
options=optimset('fmincon');
options.Display='iter';
options.Algorithm='interior-point';
fitnessfcn = @(x)Lobo(d0_actual, x(2), x(3), x(4), x(5));
nonlcon1 = @(x)nonlcon(d0_actual, x(2), x(3), x(4), x(5));
lb = [0.08, 9.14, 10, 1, 0.1];
ub = [1, 18.3, 1300, 25, 1];
[X, fval] = fmincon(fitnessfcn, x0, [], [], [], [], lb, ub, nonlcon1, options);
Xmat(i,:) = X(:);
X
disp(X);
end
plot(d0(i), Xmat(i,1));
  8 个评论
Torsten
Torsten 2018-4-4
If you write d0=0.01:1, the step size is automatically chosen to be 1. Since 0.01+1 = 1.01 > 1, lower limit + stepsize > upper limit. Thus d0 = 0.01 only.
Best wishes
Torsten.

回答(0 个)

此问题已关闭。

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by