Loop for local function:fmincon
Mostra commenti meno recenti
Dear all,
I want to make a loop for the code below: every step, I want to update objective function in such a way that pr=p.
I would appreciate any thoughts and helps!
Dat
function [p,fval] = MC_NT(p0,opts)
if nargin < 2
opts = optimoptions('fmincon','Algorithm','interior-point');
end
[p,fval] = fmincon(@Obj,p0,[],[],Aeq1,beq1,[],[],[],opts);
function f= Obj(p)
f = 0;
pr=0.25*ones(1,16);
for i = 1:16
f = f + p(i)*log(p(i))-p(i)*log(pr(i));
end
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Argument Definitions in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!