Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: How to delete an element from its position
Replies: 1   Last Post: Mar 23, 2013 1:23 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
dpb

Posts: 8,296
Registered: 6/7/07
Re: How to delete an element from its position
Posted: Mar 23, 2013 1:23 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 3/23/2013 12:13 PM, IIT wrote:
> I have a vector which is having repetitive elements, and I want to
> delete the element from a particular position.
>
> A=[ 1 2 3 2 5]
>
> and I want to delete 2 from 4th position, pl help me out ...


ix=find(A==A(histc(A,[unique(A)])>1));
A(ix(1):ix(2))=[];


--



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.