How to find the x and y coordinates corresponding to a given value of f(x,y)?

조회 수: 18 (최근 30일)
I have plotted f(x,y). I have obtained the maxima of the plot and now, I would like to know the values of x and y at which I have obtained this maxima.
  댓글 수: 3
Yatish Yatish
Yatish Yatish 2019년 10월 11일
편집: Yatish Yatish 2019년 10월 11일
@Adam Danz Using max(max(f))
Adam
Adam 2019년 10월 11일
doc max
shows you that there are two output arguments from the max function. The seconod gives you the location at which the max is found. The first, obviously, is the max itself. Those are your x and y. Or at least an index into an x vector, to be more precise.

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

채택된 답변

Matt J
Matt J 2019년 10월 11일
maxval=max(f(:));
[xmax,ymax]=find(f==maxval);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by