Simple operation with vectors
3 次查看(过去 30 天)
显示 更早的评论
I have two vectors, x and y, and I plot the function y=f(x) with the command plot(x,y). I need to know what is the value of x corresponding to the maximum value of y. For example if
x=[1.2 1.4 1.6 2.5 3.7]
and
y=[3.2 4.8 5.6 4.4 3.1],
then I have to obtain 1.6, since the third element of x corresponds to the maximum value of y. How can I implement this command? Thanks
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Formatting and Annotation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!