I want to find the minimum value.

1 回表示 (過去 30 日間)
Jeong
Jeong 2012 年 7 月 24 日
Here is command window
>> M=randi(40,3,5)
M =
33 37 12 39 39
37 26 22 7 20
6 4 39 39 33
>> X=M(:)
X =
33
37
6
37
26
4
12
22
39
39
7
39
39
20
33
>> Min=min(X) ??? Index exceeds matrix dimensions.
>> Max=max(X)
Max =
39
>> mean(X)
ans =
26.2000
>> sum(X)
ans =
393
>> min(X) ??? Index exceeds matrix dimensions.
*I was trying to find min value but I can't
How to find the minimum value?*

採用された回答

venkat vasu
venkat vasu 2012 年 7 月 24 日
You clear the command window using clear all command then you try surely will get or else Instead of you can use the code
l=sort(X); Min=l(1);
  1 件のコメント
per isakson
per isakson 2012 年 7 月 25 日
編集済み: per isakson 2012 年 7 月 25 日
An important rule of thumb:
Never ever use a function name of Matlab as the name of a variable.
IMO: "Min" should not be used as the name of a variable, since "min" is the name of a function.

サインインしてコメントする。

その他の回答 (2 件)

per isakson
per isakson 2012 年 7 月 24 日
Try
which min -all
  1 件のコメント
Walter Roberson
Walter Roberson 2012 年 7 月 24 日
Right. In other words, you have created a variable named "min".

サインインしてコメントする。


venkat vasu
venkat vasu 2012 年 7 月 24 日
I have tried same value and i got the min value. i'm using 2011b. which version you are using.

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by