How to remove a specific object from cell

2 次查看(过去 30 天)
I have a cell containing objects.
AllObjects = {obj1 , obj2 obj3 ....., obj10}
i want to remove obj3 from AllObjects cell.

采纳的回答

Adam Danz
Adam Danz 2019-8-20
编辑:Adam Danz 2019-8-21
Try this out
% identify the index of cell array "AllObjects" that contains "obj3"
idx = cellfun(@(x)isequal(x,obj3),AllObjects); %logical index
% Remove that index from cell array
AllObjects(idx) = [];

更多回答(1 个)

JIAYING WU
JIAYING WU 2019-8-20
AllObjects(3) = [ ];

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by