Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
find コマンドはどのように使用されますか?, 負の例と正の例の間でベクトルの最大数を選択するには:
a=[-15 7]
符号に関係なく最大の数を選ぶ
maxではなくを使用find:
max
find
[vv ii] = max(abs(a)); result = a(ii)
の 2 番目の出力引数は、最大化要素 (複数ある場合は最初の要素)のインデックスmaxを与えることに注意してください。