how to find argmin to this vector

조회 수: 102(최근 30일)
Murali Krishna AG
Murali Krishna AG 2020년 11월 24일
댓글: Murali Krishna AG 2020년 11월 24일
c=argmin f(a,b).where both a,b are M*1 and N*1 column matrices respectively.
How to get a,b for minimum value of f(a,b) from matlab
  댓글 수: 2
Murali Krishna AG
Murali Krishna AG 2020년 11월 24일
Eg: Let function f=A^2+B^2+A*B+2*A^2*B
where A,B are known column matrices
Input:A,B
Expect output A,B.
I want to find in which A,B matrices the functiuon f could be minimum

댓글을 달려면 로그인하십시오.

채택된 답변

KSSV
KSSV 2020년 11월 24일
Are you looking for something like this?
Let a,b be your column matrices.
[a,b] = meshgrid(a,b) ; % make them a matrix
F = f(a,b) ; % evaluate your function, use element by element operations in f
[val,idx] = min(F(:)) ;
amin = a(idx) ;
bmin = b(idx) ;
Have a look on fmincon.

추가 답변(0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by