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