# Questions tagged [variable-definitions]

Questions on assigning and unassigning definitions to names that represent them, including issues raised by context and localization. Use tag [assignment] for issues relating to Set versus SetDelayed.

433 questions
Filter by
Sorted by
Tagged with
47 views

### Problem with KarhunenLoeveExpansion's output

I have a matrix called realizationMat, it contains 101 measurements of 90 realizations of a stochastic process. I will post instead an abridged 11*5 smaller example ...
760 views

### Different strategies to get a clean Kernel. Quit, Exit, ClearAll, Remove, CleanSlate?

Often new users face problems with lingering definitions that, if unaware, may cause unexpected and frustrating behaviour. There are several answers that illustrate different aspects of the solution, ...
24 views

### KroneckerProduct with arbitrary number of Pauli matrices

I want define a function of n variables as follows $$f(x_1, ..., x_n)= KroneckerProduct[\sigma^{x_1}, ..., \sigma^{x_n}]$$ where $\sigma^{x_i}=PauliMatrix[x_i]$. Given a number $n$, I can explicitly ...
49 views

### Definition of multiple variables from a list

I have a list of the form {{0, 0, 0, 0, 0, 0, a, b, c, d, e, f}, {0, 0, 0, 0, 0, 1, a, c, b, d, f, e}, {2, 2, 2, 2, 1, 2, b, f, c, a, d, e}, ... } and I would ...
73 views

### Module inside With, With inside Module, or Just Module?

In general, if one wants to define local variables and local constants, which of the following is the best programming practice in terms of performance and code "safety"? (Assume ...
102 views

### Solve using PolyGamma function

I am trying to solve for the value of y. My code is: x = 0.165; f = -Log[y] - PolyGamma[0.5 + 0.2*(x/y)] + PolyGamma[0.5]; Solve[f == 0, y] Running gave me ...
42 views

### How to declare a list of symbols as Real numbers?

I have a list of symbols : gammaVecs =Table[Symbol[StringJoin["gamma", ToString@j, ToString@i]], {j,7}, {i, 40)}]; Which I want to use later in ...
309 views

### Is it possible to define conjugate of a function?

Could you help me, please? I have two complex functions of real variable f[x] and fc[x] such that one is a conjugate of another one. I'd like to take a conjugate of an expression that includes both of ...
70 views

239 views

### Functions without arguments [duplicate]

In the course of a project recently I had to use a particular function u[x, t] a number of times. Because in mathematics I would typically write this function as \$...
51 views

### Simplify terms with delayed and immediate function definitions

Say I want to define a function fwith input x but also involving parameter p not yet ...
488 views

### Another difference between Set and SetDelayed. Evaluation shortcut?

A little while ago I wondered why f[x_] = f[x] gives an infinite iteration. I ended up discovering the following difference in evaluation between ...
68 views

### Are symbols automatically generated when defining a variable in the global context and what are symbols?

Abstract: I have noticed something really tricky with Mathematica and the documentation for symbols is short on clearing the confusion. It likely reveals what symbols are but it's not very prominent. ...
238 views

### How to clear all definitions matching f[1, …] but not f[2, …]?

I would like to clear all definitions of the form f[1,...] in such a way that f[2,...] remain unaffected. The two methods I know ...
44 views

### Definition of a real variable

I would like to calculate a definite integral with a real parameter "a". I tried Refine[Element[a, Reals]] and Simbols [Element] Reals but the yield was a ConditionalExpression dealing Im[a] and Re[a]...