Mathematica symbols are the ultimate atoms of symbolic data. Every symbol has a unique name, exists in a certain Mathematica context or namespace, and can have a variety of types of values and attributes.

learn more… | top users | synonyms (2)

35
votes
2answers
1k views

Is there a way to separate variables between multiple notebooks?

I often correct homework by checking the calculations in Mathematica. Sometimes you would like to have two solutions open at once. However often defined symbols such as ...
30
votes
1answer
765 views

Local variables in Module leak into the Global context

From the Mathematica documentation on Module: Module allows you to set up local variables with names that are local to the module. But after using ...
28
votes
3answers
1k views

Is there an equivalent of MATLAB's Workspace window in Mathematica?

For example, in MATLAB, a panel is available where one can see straightaway which variables are used and their dimension sizes. Is such a feature available in Mathematica? I really find it hard to ...
27
votes
1answer
514 views

What is the story with Removed symbols?

The system function Remove evidently exists primarily to turn a fatal problem into an annoying one, by giving the user a (rather blunt) instrument with which to ...
25
votes
2answers
1k views

How can I use the Klingon alphabet symbols?

Mathematica apparently supports the Klingon alphabet: MemberQ[$CharacterEncodings, "Klingon"] True UnicodeFontMapping.tr excerpt: ...
22
votes
5answers
8k views

How do I clear all user defined symbols?

Is there some way to do this other than going to Evaluation -> Quit kernel and firing a new one up?
19
votes
5answers
1k views

How to pass a symbol name to a function with any of the Hold attributes?

Given a function with the attribute HoldFirst, HoldAll or similar, and a variable, list, how ...
18
votes
5answers
682 views

How do I reassign canonical ordering of symbols?

I have a big polynomial that evaluates to: $$A^2 e^2 \phi ^- \phi ^++A e \phi ^- \phi ^+ c_{2 w} g_Z+\frac{1}{2} A e g h W^- \phi ^+ +\ll13\gg,$$ which is supposed to represent some terms in the ...
18
votes
0answers
195 views

Are greek symbols causing different evaluation?

I've updated today to Mathematica 9.0.1.0 from version 8 and found something that absolutely confuses me. Let us define a piecewise function: ...
16
votes
4answers
710 views

How can I randomly generate a unique, unused symbol?

In a previous question on collecting terms for a multivariable polynomial, I answered with a solution that required a unused symbol to be used for a temporary substitution and back substitution. It ...
15
votes
2answers
512 views

Automated testing for compatibility with older Mathematica versions

I have several packages which I actively develop and maintain. I try to stay up to date with new releases of Mathematica and usually update within a couple of months of a new version coming out. As a ...
14
votes
6answers
854 views

How to clear all variables except one?

I have a lot of variables: $a,b,c,d, \ldots $ I want to clear the values of all of them except $b$. It's really lengthy to write Clear[a]; Clear[c]; ... Is ...
14
votes
3answers
210 views

How can I test properties of a symbol from the string name without the symbol completely evaluating

Suppose I have a few symbols, one of which has a value: {abc1, abc2 = 5, abc3}; I can use Names to get the list of names, as ...
14
votes
1answer
269 views

Is the sharing of variables in Module/Block within Compile documented behavior?

Today I noticed something, I think for the first time. When used inside Compile variable values within Module (and ...
14
votes
2answers
174 views

How to find the package file that stores a certain symbol?

Is it possible to figure out in what file a certain packaged symbol lives in (assuming there is no shadowing between multiple identical symbol names)? I would like to have a function that if, given a ...
13
votes
2answers
406 views

Defining symbol shortcuts in the Front End

I was wondering (because I could not find any documentation on this) if it is possible to do shorthand abbreviations for domains or could one define them? E.g. In[1]:= Element[p,Complexes] ...
11
votes
2answers
768 views

How to unload automatically loaded packages?

I know that this has been discussed here (How do I clear all user defined symbols?), but my case is somewhat different. How does one unload packages during runtime that were loaded with the start of ...
10
votes
2answers
529 views

How do you programatically load data into symbols?

I am trying to convert a list of string names into symbols, which will then be used to store data. I have 24 files (where the name of each file is a member of the list mentioned above) that I need to ...
9
votes
1answer
218 views

Get the name of a symbol passed to a function

I'm trying to get the name of a symbol passed to a function with this: f[x_] := {SymbolName[x], x} SetAttributes[f, HoldFirst] x = 5; f[x] But ...
8
votes
2answers
563 views

List of Mathematica textual symbols

Context I am using Mathematica to create live documents - documents that are both interactive and show mathematical derivations. Now, I'm aware that there are certain symbols that are available via: ...
8
votes
1answer
439 views

How to properly DumpSave & Get Global`s symbols inside packages while not touching Global context?

For efficiency reasons I prefer to use DumpSave instead of Save. For ease of access I prefer to save symbols in ...
8
votes
1answer
131 views

Is it possible to write a function immune to symbol redefinitions in any Block surrounding its invocation?

Normally, semantics of symbols used in a function definition can be changed by their redefinitions in Blocks surrounding the function invocation: ...
7
votes
3answers
877 views

Guidelines on giving readable names to variables [closed]

I know that one cannot use underscore to a variable name, like degree_of_The_First_Polynomial. But for a long variable name, it ...
7
votes
3answers
240 views

How to set a TraditionalForm output for a symbol

How do I set a TraditionalForm output for a particular symbol/function? In particular I would like my user-defined symbol ...
7
votes
2answers
267 views

Telling mathematica to output * instead of space for multiplication, so I can copy as plain text

I am trying to get some symbolic expressions in Mathematica which I would like to paste into my C/MATLAB codes. This can be accomplished nicely by selecting the expression and right-clicking to ...
7
votes
1answer
80 views

How to convert \[Formal…] symbols to standard ones in an expression?

Mathematica generates an expression sometimes using \[Formal] symbols. This is causing a problem with the TeXForm code generated ...
7
votes
1answer
226 views

Defining my own invisible operator

There are some invisible operators in Mathematica (\[ImplicitPlus],\[InvisibleTimes],...
6
votes
2answers
212 views

Not FullDefinition for Save. MachineID not Protected?

Is there a way to set what symbols's definitions I do not want to store? Consider the following code: ...
6
votes
1answer
59 views

How to reset the $ModuleNumber?

According to the documentation, we can reset $ModuleNumber to a positive machine integer. There is even an example in the doc: ...
6
votes
1answer
150 views

Go to definition of symbol/variable

Is there any easy way of directly jumping to the definition of a Variable like it is implemented in some good IDEs? Currently I have to search manually (ctrl+f) through the whole workbook to find it ...
5
votes
1answer
400 views

Using the symbol I for electrical current [duplicate]

I would like to use the I as a symbol for the electrical current. How can I redefine it, so it is not interpreted as the imaginary unity?
5
votes
1answer
296 views

Using external variable as a variable inside WhenEvent & NDSolve

I'm trying to use the new WhenEvent functionality of NDSolve in Mathematica 9, in order to perform an action when a variable in the system reaches a certain value. I would like this variable to come ...
5
votes
2answers
195 views

Delete contexts from a string representation of a symbol

I want to delete the string representing the context of a symbol. For info I need such a functionality in my ShowIt function defined here I'd like to know how I ...
5
votes
1answer
103 views

Remove Removed From Output

How might I remove Removed[..] symbols from the output of an expression? For example Clear[b]; b := Sin[a + a]; Remove[a]; b ...
5
votes
1answer
123 views

Functions, Options and Symbols

In the normal Mathematica language, where no built-in symbols are redefined and no evil things happen, is it a valid assumptions, that no function symbol (Plot, ...
5
votes
1answer
1k views

How to create symbol whose name has subscript?

I can do Symbol["foobar"] to create a symbol foobar. How to create a symbol $\theta_1$? ...
5
votes
0answers
240 views

Whats the best practice of using subscripts in symbols?

I have stumbled over several issues about subscripted symbols recently. I would like that I can enter subscripted variables with my keyboard and that they are treated as symbols. I would also like to ...
4
votes
2answers
115 views

Lesser and greater symbols in the axeslabels

I need a plot with $\Gamma^<$ as axeslabel using: AxesLabel -> { $\Gamma^<$} But I get an error. AxesLabel -> { $\Gamma^{a<b}$} works though. I think I've to tell mathematica that ...
4
votes
3answers
224 views

Running out of variables

I am running symbolic calculations with Mathematica. Simplification of algebraic expressions is an important part of them as very often final results can be simplified considerably. Typically my ...
4
votes
1answer
546 views

FeynCalc “May shadow or be shadowed by other definitions”

So I've downloaded the latest FeynCalc from this site and put the extracted folder in user/me/library/Mathematica/application, but when I write the command ...
4
votes
2answers
236 views

Using Greek letters with subscripts as symbols

I'd like to use Subscript[ϕ, 1] as a function name: Subscript[ϕ, 1][x_] = C1 + C2*x + C3*Exp[α*x] + C4*Exp[-α*x] But as I use ...
4
votes
1answer
187 views

Manipulate a Plot that contains a variable that contains symbol [duplicate]

This snippet mm = m Manipulate[{mm, Plot[mm x, {x, 0, 1}]}, {m, 0, 1}] (m is not defined anywhere) produces a sadly fixed ...
4
votes
0answers
79 views

Is there a way to check whether two notebooks share the same variables?

When I code in Mathematica, I often re-use code from old notebooks which fulfilled a specific purpose; for example, one testing for soft matches in strings, or one that identifies outliers on a graph ...
3
votes
2answers
120 views

How to open directly the help/reference window from a notebook

I'm used to do ??symbol when I want the reference for a given symbol, then I click on the >> arrows to open the help window. Would it be possible to ...
3
votes
2answers
189 views

Replace every Minus to Plus in Expression

Thought this is a rather simple thing, but I was not able to find a solution: I have a polynomial expression like: expr1=a^2-b+c*d expr2=a-b expr3=-a+b-c and ...
3
votes
2answers
131 views

Stopping a head from evaluating more than once

While attempting to answer my own question, Is there a way to "hold" prefix / infix / postfix notation?, I came across the need to evaluate a recursive function only one level deep. For ...
3
votes
1answer
104 views

Displaying the meaning of an operator using Information

I'm using CircleTimes ($\otimes$) operator defined as a_\[CircleTimes]b_ := KroneckerProduct[a, b] so I can use ...
3
votes
1answer
117 views

Dynamic generation of Buttons

The Project I am trying to dynamically turn on/off the display of data for a circos-esque plot that I generated. The Code I have data stored in mfData and a ...