필터 지우기
필터 지우기

How to convert a matrix like this?

조회 수: 4 (최근 30일)
Phung Minh
Phung Minh 2018년 9월 4일
댓글: Phung Minh 2018년 9월 4일
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
madhan ravi
madhan ravi 2018년 9월 4일
Thank you @Guillaume :)
Phung Minh
Phung Minh 2018년 9월 4일
Thank you ?

댓글을 달려면 로그인하십시오.

추가 답변 (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