Effacer les filtres
Effacer les filtres

How to remove rows from a table based on row value?

1 vue (au cours des 30 derniers jours)
Tanu Shree
Tanu Shree le 21 Juin 2020
Commenté : Tanu Shree le 22 Juin 2020
I am new to matlab.
I have below two tables t4 and t5. I want to remove rows from t5 where Id column matches from t4.
t4
t4 =
8×6 table
Id IC_01 IC_07 IC_05 IC_16 IC_26
_____ ___________ __________ _________ ___________ __________
10001 0.2 0.014466 0.0041359 0.00065841 -0.0027416
10002 0.0090867 0.0092911 0.0070487 -0.0020759 -0.0022272
10003 0.5 0.014684 0.010444 -0.0052934 -0.0029127
10004 0.0046753 0.00095655 0.0061542 -0.00042915 -0.0012221
10005 -0.00039777 0.0068783 0.0090508 0.00036861 0.00033614
10006 0.0003344 0.0053108 0.010053 0.0069197 -6.46e-05
10007 0.0051918 0.010585 0.01216 -0.00091951 -0.002255
10008 0.0077448 0.0097479 0.0093559 -0.0042185 -0.0038524
>> t5
t5 =
11×6 table
Id IC_01 IC_07 IC_05 IC_16 IC_26
_____ _________ __________ _________ ___________ __________
10001 0.0060698 0.014466 0.0041359 0.00065841 -0.0027416
10002 0.0090867 0.0092911 0.0070487 -0.0020759 -0.0022272
10003 0.008151 0.014684 0.010444 -0.0052934 -0.0029127
10004 0.0046753 0.00095655 0.0061542 -0.00042915 -0.0012221
10005 -0.10004 0.0068783 0.0090508 0.00036861 0.00033614
10006 0.0003344 0.0053108 0.010053 0.0069197 -6.46e-05
10007 0.0051918 0.010585 0.01216 -0.00091951 -0.002255
10008 0.0077448 0.0097479 0.0093559 -0.0042185 -0.0038524
10016 0.0003344 0.0053108 0.010053 0.0069197 -6.46e-05
10017 0.0051918 0.010585 0.01216 -0.00091951 -0.002255
10018 0.0077448 0.0097479 0.0093559 -0.0042185 -0.0038524

Réponse acceptée

madhan ravi
madhan ravi le 21 Juin 2020
t5(ismember(t4{:,1},t5{:,1}), :) = []
  2 commentaires
Tanu Shree
Tanu Shree le 22 Juin 2020
Thank you! It worked.
Tanu Shree
Tanu Shree le 22 Juin 2020
If I have to do the manupulation like join two table t4 and t5 and want to replace values in t4 from t5? Is that possible to acheive ?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Tables dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by