Filter löschen
Filter löschen

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

2 Ansichten (letzte 30 Tage)
a=[5 10 15]
b=[20 25 30]
c= ?

Akzeptierte Antwort

James Tursa
James Tursa am 17 Sep. 2016
c = [max(a) max(b)];

Weitere Antworten (1)

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

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by