Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

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

1 Ansicht (letzte 30 Tage)
Devdatt Thengdi
Devdatt Thengdi am 4 Apr. 2018
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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 Kommentare
Torsten
Torsten am 4 Apr. 2018
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.

Antworten (0)

Diese Frage ist geschlossen.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by