Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我有以下
A = [1 2 3]
和
Z = [1 2 3 4 5 6]
如何从 Z 中删除 A 的值,以获得
Z = [4 5 6]
在 Matlab 中?
像这样的东西:
>> Z(ismember(Z,A))=[] Z = 4 5 6
或者简单地说,
>> Z = setdiff(Z,A) Z = 4 5 6