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

조회 수: 3 (최근 30일)
Susan
Susan 2019년 4월 29일
댓글: Susan 2019년 4월 29일
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개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by