How to convert a matrix like this?

4 次查看(过去 30 天)
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!

采纳的回答

madhan ravi
madhan ravi 2018-9-4
编辑:madhan ravi 2018-9-4
Try this:
A(A==0)=[]
  6 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Sparse Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by