how to delete an element from a particular position from a vector of repetitive elements

2 次查看(过去 30 天)
I want to delete the element from a particular position in the vector as I have repetitive elements in that vector.
For example, I have
A =[1 2 3 2 5];
and I want to delete 2 from 4th position. Help me out

采纳的回答

Cedric
Cedric 2013-3-23
You might just want to use UNIQUE..
>> b = unique(A) ;

更多回答(1 个)

naman
naman 2013-3-24
Thanks for the answer, its working for this particular vector. But here the condition is bit different. I mentioned from a particular position because I can have the vector of type
A=[ 1 2 3 2 5 2]
now again, i want to remove only 4th element. So pl consider according to generalize vector. Thanks

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by