Error using fmincon Supplied objective function must return a scalar value
Show older comments
C1=log(1+(h(1,1).*P(1,1)/n+x1));
C2=log(1+(h(2,2).*P(2,1)/n+x2));
C3=log(1+(h(3,3).*P(3,1)/n+x3));
C4=log(1+(h(4,4).*P(4,1)/n+x4));
C=[C1,C2,C3,C4];
M=4;
w=linspace(0,1,M);
C_sum= C.*w;
Pimax(1:4)= 10^-4;
x0 = ones(64,1);
c_lin = [H',zeros(1,48);zeros(1,16),H',zeros(1,32);zeros(1,32),H',zeros(1,16);zeros(1,48),H'];
b = Pimax;
X = fmincon(@myfunc,x0,c_lin,b);
function C_sum1=myfunc(C_sum)
C_sum1=C_sum;
end
Accepted Answer
More Answers (0)
Categories
Find more on Transforms 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!