MathGroup Archive 2007

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

Search the Archive

Re: Delete all the memory except 1 matrix


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