Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.


Shobana
Posts:
13
Registered:
12/20/12


deleting elements from vector
Posted:
Dec 25, 2012 2:07 AM


hai friends... I need to delete some values in the vector based on the values in the another vector for example: e = [1 1 0 0 2 3 , . . . . n] a = [1 2 3 4 5 6 ...........n] the result should be like this b = [1 2 5 6.....n] the value of 'a' corresponding to the place where e = = 0 should be removed.I tried like this for j =1:length(e) if(e == 0) data[j] = []; end end
but it gives wrong answer like [1 2 4 6..n] .here the length of 'a' and 'e' are same.please reply me as soon as possible



