필터 지우기
필터 지우기

How to find minimum element from an array.

조회 수: 2 (최근 30일)
priyanka
priyanka 2014년 11월 3일
댓글: priyanka 2014년 11월 3일
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
James Tursa
James Tursa 2014년 11월 3일
What do you get when you type in
which min
priyanka
priyanka 2014년 11월 3일
Its working. Thank you

댓글을 달려면 로그인하십시오.

추가 답변 (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