Remove specific cells in a cell array
77 次查看(过去 30 天)
显示 更早的评论
I have a field_list that contains a large number of cells I will show a simple example :
fields_list = {'mode','time','date','Nav','state',...};
and I have another list for the fields I want to remove, for the same example:
remove_list = {'mode','date','Nav',,...};
is there a way to remove the 'remove_list' from the field_list' ?
Taking into account that the the fields_list and the remove_list are much bigger than this.
0 个评论
采纳的回答
Voss
2023-2-15
fields_list = {'mode','time','date','Nav','state'};
remove_list = {'mode','date','Nav'};
fields_list(ismember(fields_list,remove_list)) = []
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Whos 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!