Table: Delete rows that contain only zeros

조회 수: 10 (최근 30일)
Ole Jonas Böken
Ole Jonas Böken 2021년 3월 17일
댓글: Image Analyst 2021년 3월 17일
Hi,
I am new to Matlab, but I could not find a solution after a lot of searching. I am trying to erase all rows that contains only zeros in a table (for instance row "topics 1").
I am using a table so I keep the "names" of the rows that should not be deleted for later use.
I am using Matlab Version R2020b.
The original table is attached.
Can anybody help?
Thanks in advance!

채택된 답변

Walter Roberson
Walter Roberson 2021년 3월 17일
mask = all(T{:,2:end}==0,2);
T(mask,:) = [];
  댓글 수: 2
Ole Jonas Böken
Ole Jonas Böken 2021년 3월 17일
Many thanks!!
Image Analyst
Image Analyst 2021년 3월 17일
You can properly give thanks by Clicking the "Accept this answer" link to award the answerer "reputation points" for helping you. Thanks in advance. By the way you can also click the " 👍 Vote" icon to double the number of points awarded. 🙂

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Identification에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by