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일

0 개 추천

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일

0 개 추천

AllObjects(3) = [ ];

댓글 수: 1

Adam Danz
Adam Danz 2019년 8월 20일
...if you already know that obj3 is in position (3)

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터 및 File Exchange에서 Structures에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by