12 questions linked to/from Turn expression into function
429 views

What is the the proper way to define a function from an expression? [duplicate]

Say after some long computation we get an expression expr=x^2 We do not know what the value of expr beforehand. Now we want ...
2k views

Defining Piecewise Functions [duplicate]

I'm having trouble defining piecewise functions. What I have so far is a function that outputs something in a suitable format for Piecewise: ...
148 views

Define function over expression [duplicate]

Suppose I have the following expression system = x + y + z And I would like to define a function that contains this function, without explicitly typing the right ...
183 views

Defining a function using a preceding expression [duplicate]

How can I automatically define a function inside my Mathematica code using a result (expression) that preceded the point of definition. For example: ...
42 views

How to turn a matrix into a 'function'? [duplicate]

I have some codes to turn a set of equations into a matrix. Suppose the matrix Lis expressed in terms of variables $\epsilon$, $K$, $M$, and I want to make a ...
33 views

How to get a function from a list element? [duplicate]

I have a set of arguments in a list like: uy = {21/2 + y/2, 13.6667 + 0.666667 y, 20 + y} Now, I want to assign a function (call it 'f(y)') to an element of that ...
3k views

Scoping in assigning a derivative

While answering another question, I stumbled upon a problem I cannot easily resolve. To assign the derivative of a function to another function, typically one can do this with a ...
471 views

How to make a function like Set, but with a Block construct for the pattern names

How can we define a function that works like f[x_]=ComputeSomething[x] and treats x as a variable that does not have a value? ...
337 views

Wrapping grid with dynamic

I'm trying to build a sortable grid: ...
599 views

Turning an expression into a function inside another function

Say I have an expression g=Sin[q]; It is easy to turn it into a function, and to perform manipulations on this function (this and variants of this were discussed ...