finding the max number?
1 回表示 (過去 30 日間)
古いコメントを表示
x=[1 3 5 7]
y=x^2+5
y=[6 14 30 54]
max(y)
how do i find x value corresponding to max(y)?
0 件のコメント
回答 (1 件)
Chunru
2021 年 9 月 12 日
x=[1 3 5 7]
y=x.^2+5 % use .^ here
[~, idx] = max(y) % idx the where y is the max
x(idx) % corresponding x
y(idx)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Structures についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!