finding the max number?
显示 更早的评论
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)?
回答(1 个)
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)
类别
在 帮助中心 和 File Exchange 中查找有关 SimEvents 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!