Find the theta1 and theta2 values that maximize the function
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi everyone! Im trying to maximize this equation by finding those theta1 and theta2:
obj8Run = @(theta) -mean(sum((1+theta1.*csecxit+theta2.*csecyit)/N.*R4-c*t4,2))./sqrt(sum((1+theta1.*csecxit+theta2.*csecyit)/N.*R4-c*t4,2))
w0 = [0.2,0.3] % initial guess
lb = zeros(1, 2)
ub = 1.5*ones(1, 2)
sol = fmincon(obj8Run, w0, [], [], [], [], lb, ub)
Matlab gives me this error problem: Error using fmincon (line 635) .Supplied objective function must return a scalar value.
Can someone help me?
Thanks in advance!!!
0 Kommentare
Antworten (1)
madhan ravi
am 10 Okt. 2020
obj8Run = @(theta) -mean(sum((1+theta(1).*csecxit+theta(2).*csecyit)/N.*R4-c*t4,2))./sqrt(sum((1+theta(1).*csecxit+theta(2).*csecyit)/N.*R4-c*t4,2))
Siehe auch
Kategorien
Mehr zu Parallel Computing Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!