Delete specific rows in table

1 Ansicht (letzte 30 Tage)
Zeynab Mousavikhamene
Zeynab Mousavikhamene am 4 Okt. 2019
Kommentiert: Daniel M am 4 Okt. 2019
I want a table that has all values that their cell_type is 4 and get rid of those row that their cell_type is not 4.
Any suggestion?Capture.JPG

Akzeptierte Antwort

Daniel M
Daniel M am 4 Okt. 2019
T(T.cell_type~=4,:) = [];
% where T is the name of your table
  1 Kommentar
Daniel M
Daniel M am 4 Okt. 2019
If you want to keep the original table and make a new table only containing rows with cell_type 4, it is trivial.
T2 = T(T.cell_type==4,:);

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Tables finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by