필터 지우기
필터 지우기

Minimisation of object function having 2d array as variables.

조회 수: 5 (최근 30일)
Akanistha Banerjee
Akanistha Banerjee 2020년 1월 19일
I want to minimise the following function using the optimtool.
eqn.png
Can anyone help me with its code. I am having problem having to use 2d array as the variables.

답변 (1개)

Thiago Henrique Gomes Lobato
Thiago Henrique Gomes Lobato 2020년 1월 19일
Any 2D array can be represented with a vector, which is the normal input to optimization functions, so all you need to do is write your function to take a vector as input and them convert it to a matrix. A minimalist example:
x = randn(7); % Original matrix
opt = fun(x(:)); % Convert matrix to a vector for function
function opt = fun(x)
x = reshape(x,7,7) % Convert vector to matrix
%... your functio
end

카테고리

Help CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by