Message Boards Message Boards

0
|
3699 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Clear unwanted symbols

Posted 10 years ago

Hi,

I want to clear all symbols but i want to keep just J and GradientDescent in this group.

?Global`*

 Global`
A   i n   x x4  \[Alpha]$    $3 $8
bfp J   n$    X  X$   \[Theta]  $4   
cp  lp   predict1  x1   y \[CapitalTheta] $5  
ex1data1    m  predict2 x2  y$   \[Theta]$ $6  
GradientDescent m$  sf   x3    \[Alpha]   \[CapitalTheta]$  $7

Is there a clever way to achieve this rather than use

ClearAll[A, i, n, ...]

Thanks

POSTED BY: Steeve Brechmann
2 Replies
ClearAll @@ DeleteCases[Names["Global`*"], "GradientDescent" | "J"]

ps. It is not really a good idea to use variables that start with UpperCase letter.

POSTED BY: Nasser M. Abbasi

Oh, it's brillant. Thanks!

For the upper case letter, it's just a convention, not an obligation :P.

POSTED BY: Steeve Brechmann
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract