MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Delete all the memory except 1 matrix

  • To: mathgroup at smc.vnet.net
  • Subject: [mg76211] Re: [mg76184] Delete all the memory except 1 matrix
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Fri, 18 May 2007 06:00:23 -0400 (EDT)
  • References: <200705171005.GAA01244@smc.vnet.net>

On 17 May 2007, at 19:05, acmilan wrote:

> Dear all,
> Please help me on this basic problem.
> If I want to clear all the calculations in history I usually use
> Clear["Global`*"];
> But what should I use if I want to delete all except one or two
> variable (for example a matrix K and M)?
> Thank you very much for your help.
> Best regards,
> acmilan.
>
>

One way:

x = 1; y = 2; z = 3;

Clear @@ (Complement[Names["Global`*"], {"x", "y"}])

{x, y, z}
{1, 2, z}

You can easily make a function out of that.


Andrzej Kozlowski


  • Prev by Date: Re: Where is the Mathematica Book in
  • Next by Date: Re: Phase Portrait
  • Previous by thread: Delete all the memory except 1 matrix
  • Next by thread: Re: Delete all the memory except 1 matrix