How can I delete rows by their name in a TABLE
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi, I want to delete some variables which are in rows. The problem is that my files has different number of rows and I don't know in every file which number of row corresponds to that variable. In this example i want to delete the following variables: "FILTER" and "STD4s". ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/507183/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/507183/image.png)
Supose my table name is "a". When I use the command MATLAB gives me this error.
a(a.Type = 'EQU',:) = [];
Error: Incorrect use of '=' operator. To assign a value to a variable, use '='. To compare
values for equality, use '=='.
When I rectify the previous code introducing ==, que error is the following:
Undefined operator '==' for input arguments of type 'cell'.
Can you help me? Thanks!
MATLAB version: R2019B
0 commentaires
Réponse acceptée
KSSV
le 2 Fév 2021
idx = strcmp(a.Type,'EQU') ; % gt the indices which has EQU
T(idx,:) = [] ; % remove the rows
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur LaTeX 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!