How to find minimum element from an array.

2 次查看(过去 30 天)
function to find Minimum element of an element. Ex: There is an array ArrCost , having elements 132 784 94 35 567. I have to find minimum number from it, but Min(ArrCost) is not Working. Is there any another function.
  2 个评论
Adam
Adam 2014-11-3
编辑:Adam 2014-11-3
What do you mean by "not working"?
min
is obviously the function that does what you say so you need to be more specific as to what is not working about it.
>> ArrCost = [132 784 94 35 567]
ArrCost =
132 784 94 35 567
>> min( ArrCost )
ans =
35
priyanka
priyanka 2014-11-3
Index exceeds matrix dimensions.
Error in PrimsAlgo (line 298) min( ArrCost ) This is the error.

请先登录,再进行评论。

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2014-11-3
a=[132 784 94 35 567]
b=min(a)
  5 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by