remove an element from vector

2 次查看(过去 30 天)
Hi, I need to find intersection of two vectors. After intersection if 0 is present i need to remove 0. Can anyone help me.

采纳的回答

Walter Roberson
Walter Roberson 2012-2-3
V(V==0) = [];
Or you could use
V = setdiff(V,0);

更多回答(0 个)

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by