How can I show the max point on a plot ?
97 ビュー (過去 30 日間)
古いコメントを表示
I am having hard time figuring out a way to show the max point on a plot
回答 (1 件)
Star Strider
2020 年 4 月 18 日
Depending on what you want to do, and if there is only one maximum:
x = 0:10;
y = -(x-5).^2;
[ymax,idx] = max(y); % Maximum Of Dependent Variable & Index
figure
plot(x, y)
hold on
plot(x(idx), ymax, '^r')
hold off
grid
ylim([min(ylim) max(ylim)+1])
.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Line Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!