Thread Subject: how to "filter" an index ?

Subject: how to "filter" an index ?

From: tvn

Date: 23 Sep, 2008 04:03:16

Message: 1 of 3

how would I filter the value at index , say 3, out of a vector a =
[ 1 2 3 4 5]? so my result would be a = [1 2 4 5] ? Thanks ,

Subject: how to "filter" an index ?

From: wapo

Date: 23 Sep, 2008 05:38:51

Message: 2 of 3

On Sep 23, 6:03=A0am, tvn <nguyenthanh...@gmail.com> wrote:
> how would I =A0filter the value at index , say 3, out of a vector a =3D
> [ 1 2 3 4 5]? =A0 so my result would be a =3D [1 2 4 5] =A0? =A0 Thanks =
=A0,

setdiff(1:5,[3])

Subject: how to

From: Bruno Luong

Date: 23 Sep, 2008 05:52:02

Message: 3 of 3

wapo <apostolos.georgakis@gmail.com> wrote in message <e3c38639-f4f9-4ad5-a885-a3f88f0e8f93@f36g2000hsa.googlegroups.com>...
> On Sep 23, 6:03=A0am, tvn <nguyenthanh...@gmail.com> wrote:
> > how would I =A0filter the value at index , say 3, out of a vector a =3D
> > [ 1 2 3 4 5]? =A0 so my result would be a =3D [1 2 4 5]

A=[5 1 2 3 4 5];
A(3)=[] % Remove the 3rd index, i.e., 2

Bruno

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com