how to find the mininmum value in a double vector ?
1 次查看(过去 30 天)
显示 更早的评论
hello every one
I have vector with double values and I want to determine the smallest value as well as irs index
vecto=[ 2.6660 2.2852 10.0000 3.2617 10.0000 10.0000 9.8532]
I use min(vecto)
but it doesn't work
any solution to this problem
mplease help me!
Thank you
回答(1 个)
Awais Saeed
2021-11-28
You are half way there. Use
[value, index] = min(vector)
1 个评论
Image Analyst
2021-11-29
I talked about how that is not the most general or robust way to do it in my answer to his duplicate question:
However it will work as long as you know in advance that the min occurs only once and no more.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!