deleting values from an array

2 次查看(过去 30 天)
I have an array R3. I need to eliminate those elements of R3 which are present in another, smaller array. Is there an easy method to do this?

采纳的回答

Jan
Jan 2018-1-4
编辑:Jan 2018-1-4
setdiff replies all elements of a vector, which do not appear in a second one:
R3 = setdiff(R3, smallerArray);
Or
R3 = R3(~ismember(R3, smallerArray))

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Structures 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by