Borrar filtros
Borrar filtros

How to find the maximum row vector from the multiple row vectors

1 visualización (últimos 30 días)
Kumar
Kumar el 9 de Nov. de 2020
Comentada: Kumar el 9 de Nov. de 2020
Hello Everyone,
I want to find the max of multiple vectors and store the maximum data points outof 5 vectors.
I wrote the following code:
Explannation:
MaxDevU(i) row vector stores (686876 data points)
MaxDevV(i) row vector stores (686876 data points)
MaxDevW(i) row vector stores (686876 data points)
MaxDevX(i) row vector stores (686876 data points)
MaxDevY(i) row vector stores (686876 data points)
I want the maximum data at each data point out of the 5 row vectors
for i= 1:length (RotSpeed)-99
maxDevU(i) = max(DevU(i:i+99));
maxDevV(i) = max(DevV(i));
maxDevW(i) = max(DevW(i:i+99));
maxDevX(i) = max(DevX(i));
maxDevY(i) = max(DevY(i));
maxDev(i)= max(maxDevU(i),maxDevV(i),maxDevW(i),maxDevX(i),maxDevY(i));
end
  1 comentario
Kumar
Kumar el 9 de Nov. de 2020
I got this error:
Error using max
Too many input arguments.
Error in Test (line 43)
maxDev(i)= max(maxDevU(i),maxDevV(i),maxDevW(i),maxDevX(i),maxDevY(i));

Iniciar sesión para comentar.

Respuesta aceptada

Rik
Rik el 9 de Nov. de 2020
You can put it in a vector, instead of using multiple input arguments:
maxDev(i)= max([maxDevU(i),maxDevV(i),maxDevW(i),maxDevX(i),maxDevY(i)]);

Más respuestas (0)

Categorías

Más información sobre Visual Exploration en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by