How can I get the max of the values of an array with Numeric Type "double"?

25 ビュー (過去 30 日間)
Alexandra Plumhoff
Alexandra Plumhoff 2014 年 8 月 19 日
編集済み: Alexandra Plumhoff 2014 年 8 月 19 日
I have an array that is filled with numbers like
a = [0.007 0.008 0.009]
In the workspace the value of a is 1x68 double.
I tried
max(a) : "Subscript indices must either be real positive integers or logicals."
or
realmax(a) / flintmax(a): "Input must be 'single' or 'double'"
So how can I get the maximum value? I want 0.009 as answer.
Thanks in advanced!

採用された回答

Adam
Adam 2014 年 8 月 19 日
max(a) should work unless you have accidentally overwritten max by using it as a variable name. In that case it would try to use a as an index into your array called max.
  1 件のコメント
Alexandra Plumhoff
Alexandra Plumhoff 2014 年 8 月 19 日
編集済み: Alexandra Plumhoff 2014 年 8 月 19 日
Thank you!
Whatever I did before...I restarted Matlab and it worked with max(a)!

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by