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

채택된 답변

Azzi Abdelmalek
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개)

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by