samira February 2016

How can I delete vector from vector in matlab

how can I delete vector from vector? For example:

a=[1,2,3,4,5]

How can I delete b=[2,3,5] from above vector to be

c=[1,4].

I have a vector that has 100 elements.

Answers


Dominic February 2016

c = setdiff(a,b)

should do the trick.

Post Status

Asked in February 2016
Viewed 3,392 times
Voted 9
Answered 1 times

Search




Leave an answer