# How can I delete rows by their name in a TABLE

조회 수: 4(최근 30일)
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". 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

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

### 채택된 답변

KSSV 2 Feb 2021
idx = strcmp(a.Type,'EQU') ; % gt the indices which has EQU
T(idx,:) = [] ; % remove the rows
Thanks!!

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

### Community Treasure Hunt

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

Start Hunting!
{"ft_lang_label":"__label__en","ft_lang_prob":0.87313455,"math_prob":0.6229782,"size":686,"snap":"2021-21-2021-25","text_gpt3_token_len":165,"char_repetition_ratio":0.09090909,"word_repetition_ratio":0.0,"special_character_ratio":0.26676384,"punctuation_ratio":0.1554054,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99239975,"pos_list":[0,1,2],"im_url_duplicate_count":[null,3,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-05-15T20:12:08Z\",\"WARC-Record-ID\":\"<urn:uuid:54f3ba55-b6d0-4d1a-9bb5-17c00694b454>\",\"Content-Length\":\"112407\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:72aa7e66-7134-45ee-98e0-ac8f3846a3a5>\",\"WARC-Concurrent-To\":\"<urn:uuid:96a75bad-2736-40cc-ab0a-ca5a85037740>\",\"WARC-IP-Address\":\"184.24.72.83\",\"WARC-Target-URI\":\"https://kr.mathworks.com/matlabcentral/answers/733798-how-can-i-delete-rows-by-their-name-in-a-table?s_tid=prof_contriblnk\",\"WARC-Payload-Digest\":\"sha1:T3HT44G5KBIMA2QKR7CE6MNAEBSDCAHN\",\"WARC-Block-Digest\":\"sha1:X7YWFZ7PXAHX2V4Z7662IUNRZXRKAI3U\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-21/CC-MAIN-2021-21_segments_1620243991378.52_warc_CC-MAIN-20210515192444-20210515222444-00532.warc.gz\"}"}