フィルターのクリア

how to display in one variable the max of each one of two arrays?

2 ビュー (過去 30 日間)
MIGUEL HERNANDEZ
MIGUEL HERNANDEZ 2016 年 9 月 17 日
回答済み: Star Strider 2016 年 9 月 17 日
a=[5 10 15]
b=[20 25 30]
c= ?

採用された回答

James Tursa
James Tursa 2016 年 9 月 17 日
c = [max(a) max(b)];

その他の回答 (1 件)

Star Strider
Star Strider 2016 年 9 月 17 日
Concatenate the vectors inside the max function call:
a = [5 10 15];
b = [20 25 30];
c = max([a; b], [], 2)
c =
15
30

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by