# Tagged Questions

Questions about the use of built-in Mathematica functions, including pure functions.

22 views

### Protected Tags Error [duplicate]

While trying to run this piece of code: ...
74 views

### Problem with plotting a function that calls FindRoot [closed]

I am having difficulties in plotting the solution of FindRoot to solve 4 variables. I defined a function and then tried tp plot it, but got an error message ...
64 views

### Covariance matrix estimation when number of variables is larger than number of observations

It is well known that the sample covariance matrix estimator results in a singular matrix if the variables is larger than the number of observations. One solution is to apply shrinkage estimators. ...
321 views

### Partial fraction expansion with complex numbers

$$\text{Apart}\left[\frac{1}{x^4+1}\right]$$ Does nothing. How can I get it to expand it. Sometimes it is useful.
68 views

### Using Apply on a function with multidimensional input

I have a user defined function which takes multidimensional input, e.g a function that takes two algebraic variables a and b as well as a matrix m and computes some rule function as: ...
64 views

### Controlling the evaluation of other arguments in pure functions [duplicate]

I have a piece of code where I would like to do the something like the following: ...
320 views

### Smoothing a unit step function

I want to smooth a unit step function for use in NDSolve so this function is a smooth function of time (t). How can I do the ...
311 views

### How does Rescale[] handle infinities?

Rescale appears to be a simple function. It just does a simple linear $y = a x + b$ type rescaling of the values: ...
80 views

### Calculation Performance (slow Plotting)

I have a functions, which is an Integral. It is exaclty this function Zf[x_] := 2*I*NIntegrate[Exp[-y^2.0 + 2.0*I*y*x], {y, 0, Infinity}]; Later I need to plot a ...
446 views

### How do I create a triangulated surface from points?

I have a set of points in a nx3 matrix and I would like to convert them into a surface, so that I may calculate its surface area. The function ListSurfacePlot3D creates the surface how I want it. ...
60 views

### List command separating multiplicative terms [closed]

I am trying to separate and store additive terms via the List command. For instance I want "AB+CD+XY" to be stored as {AB, CD, XY} This has worked well, but when there is only one term (only ...
57 views

### How do I express an equality as a function of one of the equality's variable?

Say I have this equality: (-52271 - 200 x + 100 x^2 - 1058 y + 529 y^2)/52900 == 0 and I want the same equality, but expressed in a function of x, as in y(x). ...
1k views

### I need F(x,y) = xy (not x*y) e.g. x= 1, y =2 so F(x,y) = 12 [closed]

I just need F(x,y) that give me e.g. x= 1, y =2 so F(x,y) = 12 Is that possible. I tried Google but not able to find a ...
93 views

### NotebookWrite a Cell with WholeCellGroupOpener option [duplicate]

Why NotebookWrite[ EvaluationNotebook[], Cell["ZZ", "Section", WholeCellGroupOpener -> True] ] produces: ...
169 views

### How can I partially evaluate a function?

I have a multivariable function, from which I'd like to define a marginalization: f(a,b,c,d,...,z) ---> g(a,1,c,d,...,z) Generally, g will have fewer argument than f, possibly none (full evaluation)....
179 views

### Absolute uncertainty and error propagation with lists [closed]

I am trying to do some error propagation using mathematica. This is my second day using the program. I am trying to take the derivative of a numerical function that is made up of the following lists. ...
439 views

### How to check the style and number of arguments like the built-in functions?

Given that I have a function sqrt[x] that I must check the style and number of argument x. I can do like this: ...
110 views

### How many arguments does a function require, and how to use that in Manipulate

The goal is to vary the order parameters in wavelet transforms in the Manipulate environment. The various transformations have arguments of different rank. For ...
55 views

### Insert several rows and problem with Return

I wanted to write myself a function that makes it possible to Insert several rows into one list. ...
59 views

### How to find all gaps of a domain of a function with Mathematica 9?

I tried it liek this: My test-function: fuu[x_] := Expand[FullSimplify[1/x]] how i find the domain: ...
125 views

### What's the difference between functions and replacement?

I used to thought that calling a function is equal to applying a rule, i.e. applying a rule of f[x_]->sth. is equal to calling a function f with definition f[x_]:=sth. However, given ...
78 views

### repeat calculate [closed]

I want　to calculate the below program x[t+1].But I can only calculate t=0,1. please tell me how to calculate t = 0 to 10. ...
119 views

### How to Implement a “Function Object” suitable for NDSolve and Finite Element Method?

I have a bunch of methods that shoud return an expression that behave like a function, i.e. an expression that, when supplied with suitable arguments, evaluate to something. A simple ...
287 views

### How to replace element of list by index

I'd simply like to replace the value x at index [[j,i]] in a two dimensional table with the value ...
87 views

### How to run a function over an increasing set of integers to find a fixed point

I have a function which runs a sum from -integer to integer based on some data, something like, schematically ...
61 views

### How to TakeWhile not zero of functions?

fuu[x_]:= 2 - x^3 + x^7 This works: TakeWhile[{5, 4, 3, 2, 2, 1, 0, 0, 0, 0}, # != 0 &] (*{5, 4, 3, 2, 2, 1}*) This ...
21 views

### Is there a list of function shorthand notations, shortcuts, and other various symbols somewhere? [duplicate]

For example how you can use // to apply some functions like Simplify instead of enclosing the argument in square brackets. Or ...
181 views

### Defining a 2-variable function over voronoi diagram

I am new to Mathematica & I am facing a problem as follows: I have created a Voronoi diagram and now I want to assign to each region, a value, i.e., I want to extend this Voronoi diagram to form a ...
116 views

### How to make a list of Plots of derivatives of a function?

I did that.. i don't see what i did wrong. How would you do this? I want to use it for ListAnimate. ...
51 views

### Strange behavior when defining a symbol/function pointwise

I am well aware of the fact that floating point number have finite precision, so one needs to be careful when comparing them. Still, I find it disturbing/surprising that the following input into ...
76 views

### Finding parameters for which a function/symbol is defined

Suppose I have a symbol/function defined pointwise like in f[1, 5] = 3 f[3] = 7 f[2, 3.4] = 8 By executing ?f I can see the ...
80 views

### What is a good way to check what kind of a function a function is?

i want a module or function or switch or If (whatever works), what asks if a function is an e function or a polynomial(a hole number one or fractorial), a exponential function, a logarithm function ...
307 views

### What is the relationship between Thread and MapThread

I hope this is not a silly question, since there are plenty of questions on Thread and MapThread. However, I still cannot quite ...
108 views

### How to find the domain of an arbitrary function?

I got stuck here: fuu[x]:= 1/x +2x^2 Reduce[Exists[{x},fuu[x]],Reals] of course it doesn't work like this. How can i check if there will be divided by zero or if ...
49 views

### Constructing a function for expanding general $n$ products

I have the following quantum mechanically motivated product: $\langle0\vert(A_1b_1 + A_2b_2 + A_3b_3)(B_1b_1 + B_2b_2 + B_3b_3)(C_1b_1 + C_2b_2 + C_3b_3)$, where $b_i$ is an annihilation operator ...
89 views

### Shadowing of optional function arguments?

I am trying to define two different packages that process some information in a different way. These packages have functions into them with optional arguments. The names of the optional arguments ...
154 views

### Transposing X and Y on a plot [duplicate]

This question has appeared in many forms online, but none directly apply to my problem. I have a quite complicated, albeit bijective function of the form ...
47 views

### Computing an inexact derivative with some terms preserved in exact form

I am beginning to learn Mathematica and have the following question: How can I return a derivative with exact numbers instead of one involving numerical approximations? My original, single variable ...
365 views

### Making Mathematica function files like in MATLAB

I'm a MATLAB user trying to get familiar with Mathematica. I have long Mathematica sheet that spits out some matrices at the end after much math. I want to run a loop over couple of different initial ...
85 views

### understanding a mathematica equation

I have found the equation below written with Mathematica, I looked at the Mathematica online guide but it is still difficult to understand the equation. Can someone write this (or part of it) in ...
568 views

### How is it possible to check if a function is even or odd?

I tried it like this: ...
130 views

### Encapsulated plot function misbehaves

To insure a collection of plots has identical appearance, the plot command is encapsulated in a function. The results are undesirable. The fiducial plot is ...
122 views

### Missing zero in the CoefficientList

The following list has a length only 10 (not 11) CoefficientList[Series[ArcTan[x]/(1-x^2),{x,0,10}],x] {0, 1, 0, 2/3, 0, 13/15, 0, 76/105, 0, 263/315} It should ...
197 views

### Converting multi variable expression into a function

So I have this rather complicated looking expression ...
69 views

### Which method to use for finding maximum without actually computing optimization function explicitly?

I am new to Mathematica and I am currently working on an optimization problem. The optimization function that I have easy to calculate for some assignment of variable but it is very difficult to ...
212 views

### I want to construct a function than the output is “Sequence”

For example if the input is x and x<10 the output is Sequence[x,0],if x>10 the output is Sequence[0,x] but obviously ...
105 views

### How can I run a summation numerous times?

I have been working on code for finding the Allan plot of generated white noise, however, I cannot figure out a way to automate it for a different range of numbers. My code is as follows: ...
69 views

### Marginal distribution with weight

Given a multi-variate distribution $P(\mathbf{x},\mathbf{y})$, I would like to obtain the marginal distribution $$P_m(\mathbf{x})=\sum\int_{\mathbf{y}}P(\mathbf{x},\mathbf{y})W(\mathbf{y})$$ In my ...