I have a cell containing objects.
AllObjects = {obj1 , obj2 obj3 ....., obj10}
i want to remove obj3 from AllObjects cell.

 Réponse acceptée

Adam Danz
Adam Danz le 20 Août 2019
Modifié(e) : Adam Danz le 21 Août 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) = [];

Plus de réponses (1)

JIAYING WU
JIAYING WU le 20 Août 2019

0 votes

AllObjects(3) = [ ];

1 commentaire

Adam Danz
Adam Danz le 20 Août 2019
...if you already know that obj3 is in position (3)

Connectez-vous pour commenter.

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by