How to find minimum element from an array.

1 Ansicht (letzte 30 Tage)
priyanka
priyanka am 3 Nov. 2014
Kommentiert: priyanka am 3 Nov. 2014
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 Kommentare
Adam
Adam am 3 Nov. 2014
Bearbeitet: Adam am 3 Nov. 2014
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 am 3 Nov. 2014
Index exceeds matrix dimensions.
Error in PrimsAlgo (line 298) min( ArrCost ) This is the error.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 3 Nov. 2014
a=[132 784 94 35 567]
b=min(a)
  5 Kommentare
James Tursa
James Tursa am 3 Nov. 2014
What do you get when you type in
which min
priyanka
priyanka am 3 Nov. 2014
Its working. Thank you

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by