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 个评论
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