If Statement Using Text in a Table

9 views (last 30 days)
What commands can I use in the following if statement to specify blank element overwrite?
% Run throught the table of 10 rows
for i = 1:10
% The word "REMOVE" has been used in a previous condition subroutine to specify the row removal in this if statment
if strcmp("REMOVE",table1(i,1)) == 1
% Emptys rows
table1(i,:) = []
else
end
end
The subroutine is executed and the table rows are not being emptied when true

Accepted Answer

madhan ravi
madhan ravi on 21 Jul 2019
T=table({'asdsa';'REMOVE'}); % example
idx=strcmp(T{:,1},"REMOVE");
T(idx,:) = [] % remove those rows
  14 Comments

Sign in to comment.

More Answers (0)

Categories

Find more on Data Type Conversion in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!