Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #14858 > unrolled thread
| Started by | Ray Koopman <koopman@sfu.ca> |
|---|---|
| First post | 2013-06-14 08:53 +0000 |
| Last post | 2013-06-14 08:53 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
Re: Removing list elements in x by list y Ray Koopman <koopman@sfu.ca> - 2013-06-14 08:53 +0000
| From | Ray Koopman <koopman@sfu.ca> |
|---|---|
| Date | 2013-06-14 08:53 +0000 |
| Subject | Re: Removing list elements in x by list y |
| Message-ID | <kpellc$hsp$1@smc.vnet.net> |
DeleteCases[x,Alternatives@@y]
----- Dr. Wolfgang Hintze <weh@snafu.de> wrote:
> I have simple question.
>
> Given two lists
>
> x = {u, v, w, w, d};
> y = {u, d};
>
> I wish to "subtract" y from x, i.e. remove exactly the elements in x
> which belong to y giving
>
> x "-" y = {v,w,w}
>
> Complement[] gives instead {v,w}.
> Note that we are talking about lists rather than sets.
>
> I'm sure there is a simple standard command, but I can't find it.
> Can you?
>
> Regards,
> Wolfgang
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web