take values from old matrix to newer

1 visualización (últimos 30 días)
tal shmuel
tal shmuel el 18 de En. de 2020
Comentada: Star Strider el 18 de En. de 2020
hello
i got from a code matrix A in size 28281X5.
at colums 3, 4 and 5 there are negetive varibles.
i want to creat a new matrix from A matrix that include all the lines from A matrix withuot the lines with the
negative varibles
thanks for the help !
Tal

Respuesta aceptada

Star Strider
Star Strider el 18 de En. de 2020
Create the output matrix ‘B’ as:
B = A(all(A(:,3:5) >= 0, 2),:) % Result
Example—
A = [randi(9, 15, 2) randi([-4 +5], 15, 3)] % Create ‘A’
B = A(all(A(:,3:5) >= 0, 2),:) % Result
  4 comentarios
tal shmuel
tal shmuel el 18 de En. de 2020
thank you !!
Star Strider
Star Strider el 18 de En. de 2020
My pleasure!
If my Answer helped you solve your problem, please Accept it!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Etiquetas

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by