how to find argmin to this vector
조회 수: 83 (최근 30일)
이전 댓글 표시
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
James Tursa
2020년 11월 24일
What does it mean to find the minimum value or index of two vectors with different lengths? Can you provide a short example of inputs and desired output?
채택된 답변
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Performance and Memory에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!