Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

# All Questions

Tagged with
15 questions
Filter by
Sorted by
Tagged with
200 views

### Assign a function within a function [duplicate]

What I'm doing wrong? 1st function works as expected but the 2nd one doesn't. What I want is to enter an algebraic expression and two numeric constants and get the same result as with the first ...
364 views

### Part not behaving the way I expect it to

p = {{1, 0, 0}, {0, 1, 0}, {0, 1, 0}}; p[[All, 3]][[1 ;; 2]] = {1, 1}; p I want to replace the first two elements of the third column of a 3x3 identity matrix. ...
56 views

### Variable assignment to a function

I am trying to do a seemingly simple thing: f[x_, y_] := x + 3 y /. {x -> -x y} the output for $x=1$ and $y=2$ is 7, so it doesn't make a substitution. How ...
44 views

### Solving for a function after replacing and substituting in an expression [duplicate]

I am trying to isolate $X(s)$ in the following expression: ...
165 views

### How can I assign a value to a multivariable function in Mathematica corresponding to only one of the variables? [closed]

If I consider a function for example: g[x_]:=x^2 and fix g[x0]=10.0 at a certain point x0, ...
119 views

### Table generation with SetDelayed function [closed]

I would like to understand why the following two outputs differ: Let us define the following data set: ...
135 views

### Initializing several values of a function

How do I initialize several values of a function at once? Consider the function f := 1; f := 2; f := 3; f[n_] := f[n] = f[n-1] + f[n-2] + f[n-3]; Is ...
3k views

### Modifying parameters: Set::setps in the part assignment is not a symbol [duplicate]

Ok, this will probably be a silly question, but I can't get my head around it. I'm making a simple module that, given a list and two integers, will swap the position of the elements in the list.(...
781 views

### How to copy a function by value?

I need to change a function symbol multiple times by assigning another symbol to it, but when I'm trying to do that the symbols overwrite each other. I'm assuming this is because the assignment is by ...
109 views

### Circumventing the default scoping: Assign a variable inside a function [duplicate]

I'm currently trying very hard to assign a variable inside a function. Therefore I'm using a function like this, which should reassign a predefined variable. ...
833 views

### Understanding Function and Variable in Mathematica for beginner [closed]

I'm reading the book of Leonid Shifrin, and I love the way the book explains the core in Mathematica. As everything is an expression, now I understand that, there ...
3k views

### Integral of Lorentzian yields different results depending on when parameter assigments are made

I'm evaluating the integral of a Lorentzian, which I know equals one. First I define the function and evaluate the integral in two slightly different ways. Surprisingly, I do not get the right answer ...
601 views

### Why does list assignment with a packed array result in unpacked values?

Bug introduced in 5.2 or earlier and fixed in 10.1.0 This is another question on the design choices in Mathematica. I understand that without direct reply from the developers it may not be possible ...