optimizing each element of a matrix based on the elements of another matrix

1 次查看(过去 30 天)
Hi MATLAB experts,
I have an objective function which is a matrix. Each element of this matrix is a function of another matrix, as it is shown in the code below. "objfun(i,j,m,k)" is a function of "ptilda (i,j,k,m)" for all k,m,i,j but I would like to maximize this specific objfun (I mean for a specific i,j,m,k) w.r.t "ptilda (i,j,k,m)".
Any idea, how I can do that?
I am using fmincon() and getting the following error:
Supplied objective function must return a scalar value.
So, I guess I should go for gamultiobj (), rigth? But I don't know how to implement that. rigth now my constraints are in the format of
lb <= ptilda <= ub and A*ptilda <= b and c(ptilda)<= 0
where ptilda is a matrix of size (max(I(:)), numel(I), numel(M), max(M(:))).
If I use gamultiobj(), how will the constraints change?
Thanks in advance. Your help would be greatly appreciated.
objfun = zeros(max(I(:)), numel(I), numel(M), max(M(:)));
for k = 1 : K
for m = 1 : M(k)
for j = 1 : J
for i = 1 : I(j)
objfun(i,j,m,k) = G(ptilda (i,j,k,m));% is a function of ptilda (i,j,k,m)
end
end
end
end

回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by