Borrar filtros
Borrar filtros

How to convert a matrix like this?

4 visualizaciones (últimos 30 días)
Phung Minh
Phung Minh el 4 de Sept. de 2018
Comentada: Phung Minh el 4 de Sept. de 2018
Hello everyone, I need a help with this problem. I would like to convert a matrix to another one, like the following examples: A=[1;2;3;0;5;7]----->A=[1;2;3;5;7] B=[0;1;3;4;5;6]---->B=[1;3;4;5;6] That means I have a new matrix without 0. Thank you very much!

Respuesta aceptada

madhan ravi
madhan ravi el 4 de Sept. de 2018
Editada: madhan ravi el 4 de Sept. de 2018
Try this:
A(A==0)=[]
  6 comentarios
madhan ravi
madhan ravi el 4 de Sept. de 2018
Thank you @Guillaume :)
Phung Minh
Phung Minh el 4 de Sept. de 2018
Thank you ?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by