How to remove a specific object from cell

2 views (last 30 days)
I have a cell containing objects.
AllObjects = {obj1 , obj2 obj3 ....., obj10}
i want to remove obj3 from AllObjects cell.

Accepted Answer

Adam Danz
Adam Danz on 20 Aug 2019
Edited: Adam Danz on 21 Aug 2019
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) = [];

More Answers (1)

JIAYING WU
JIAYING WU on 20 Aug 2019
AllObjects(3) = [ ];

Categories

Find more on Matrices and Arrays 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!