Borrar filtros
Borrar filtros

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

2 visualizaciones (últimos 30 días)
a=[5 10 15]
b=[20 25 30]
c= ?

Respuesta aceptada

James Tursa
James Tursa el 17 de Sept. de 2016
c = [max(a) max(b)];

Más respuestas (1)

Star Strider
Star Strider el 17 de Sept. de 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

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by