I want to find the x and y values of f(x,y) when f(x,y) is a minimum over x = -1:0.001:1 and y = -1:0.001:1.
조회 수: 2 (최근 30일)
이전 댓글 표시
I know how to get min(f). min(x) and min(y) just give -1, not their values when f(x,y) is a minimum. Please help. Thanks
댓글 수: 0
채택된 답변
Azzi Abdelmalek
2016년 8월 27일
x=-1:0.001:1
y=x
[ii,jj]=ndgrid(x,y]
z=sin(ii)+cos(jj) % Example
[min_val,index]=min(z)
xidx=x(index)
yidx=y(index)
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!