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

learn more… | top users | synonyms

3
votes
1answer
134 views

How can you get the area of a region from an image?

Suppose we have a square of side "L" m, How can I calculate the hatched area, if the corners of the square are centers of circles. It can be generalized to any region? edit: This is the result I ...
2
votes
1answer
48 views

Appending Delayed Evaluation

I have a function that need to be summed over all parameters given in a separate list. f[x_,y_,z_,n_,i_]:= (*Some function*); list={{n1,i1},{n2,i2},...}; I need ...
6
votes
2answers
171 views

Round vs. Floor vs. Ceiling for non-integers non-orders-of-magnitude

I understand that Round give the nearest even integer for cases where the number is between two integers, i.e. Round[2.5] = 2 ...
1
vote
1answer
69 views

DownValues when using Set and SetDelayed

It is known from several questions asked in SE that one of the basic differences between Set and SetDelayed is that the former ...
0
votes
1answer
58 views

Applying corresponding elements of a list to a list of functions

I found this post which applying a function to a list of functions and arguments. I thought I could change my code with a table to something more elegant. I am not wedded to the ...
2
votes
1answer
69 views

Use Map with multiple arguments over a nested list

I noticed there are a few similar questions to mine on here, but I couldn't figure out how to accomplish this mapping. I have sets of data I want to plot, which represent intensity and frames, and I ...
0
votes
3answers
76 views

Confusing “Part::pspec” and “Part::partw” following call to ParametricPlot3D

The problem I'm having is that the function definition given below continually gives me baffling error messages. I'm trying to turn a list of 3D points into a function that approximates a curve by ...
2
votes
2answers
143 views

Multiply pure function with scalar

Somtimes I still get lost in the Hold, HoldAll etc. functions of Mathematica. I want to scale a simple PDF function with a previously calculated variable e.g. ...
1
vote
0answers
54 views

Union sorting after ignoring some digits

I have a list with its bellow elements: {-0.7071067811865476, -0.7071067811865475, 0.7071067811865475, 0.7071067811865476} If I use Union, but there is no change. Because the numbers are different. ...
0
votes
1answer
43 views

Mapping Linear Model Fit Over An Arbitrary Number of sets

I have multiple sets of data, and I want to apply Linear Model Fit sequentially to each set of data. For example, below tstlst contains 3 data sets. Right now I ...
1
vote
0answers
50 views

How to test for a non--zero rational function? [duplicate]

I want to test if a rational function in one variable is identically zero. I was surprised that just writing f==0 doesn't do it. I wrote the following code: ...
0
votes
1answer
68 views

Plotting the tangent of a curve [duplicate]

I'm new to Mathematica and this is probably child's play for most people, but I wanted to know how to plot the tangent of the function below at the point e=1/4 : ...
0
votes
2answers
89 views

Examining the equations of a Differential Op Amp

I want to examine the equations of a differential Operational Amplifier, specifically I want to examine how the tolerances of the resistors affect the resulting differential gain and common mode ...
4
votes
0answers
82 views

Is there an elegant way of delaying evaluation of `A==B` when calling a function that uses this pattern

Suppose I wanted to define a number of functions that accepts expressions of the form: ...
0
votes
2answers
34 views

How to get Complement function working in a For loop? [closed]

I've been working on a piece of code that will delete small components from a nested uneven matrix (n pages, n rows, 3 columns), by deleting the pages with less than ~30 rows. However, I've notice ...
4
votes
2answers
117 views

Initializing several values of a function

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

Split/unmerge merged cells in notebook file

I have merged cells in a Notebook file. Is there a way to split such a merged cell group back to single cells, in each of them being one command?
1
vote
1answer
69 views

Apply solution rules to new functions as parameters [duplicate]

Update: I put an screenshot of how my code and problem look like at the end. Say that Mathematica solved a system of equations and got two answers {{a -> 3, b -> c, d -> 0}, {a -> -3, b -> 0, c -> ...
0
votes
0answers
19 views

Protected Tags Error [duplicate]

While trying to run this piece of code: ...
2
votes
0answers
54 views

Problem with plotting a function that calls FindRoot

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 ...
2
votes
0answers
40 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. ...
3
votes
1answer
86 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.
1
vote
2answers
59 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: ...
1
vote
3answers
60 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: ...
3
votes
1answer
113 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 ...
14
votes
1answer
158 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: ...
0
votes
1answer
61 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 ...
12
votes
1answer
293 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. ...
-1
votes
1answer
57 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 ...
1
vote
1answer
37 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). ...
2
votes
4answers
770 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 ...
6
votes
0answers
65 views

NotebookWrite a Cell with WholeCellGroupOpener option

Why NotebookWrite[ EvaluationNotebook[], Cell["ZZ", "Section", WholeCellGroupOpener -> True] ] produces: ...
2
votes
2answers
99 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 ...
1
vote
1answer
85 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. ...
8
votes
5answers
351 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: ...
1
vote
1answer
88 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 ...
1
vote
2answers
47 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. ...
1
vote
1answer
42 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: ...
2
votes
1answer
81 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 ...
0
votes
1answer
64 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. ...
1
vote
0answers
75 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 ...
1
vote
3answers
99 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 ...
2
votes
1answer
60 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 ...
1
vote
1answer
58 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 ...
0
votes
0answers
16 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 ...
2
votes
3answers
135 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 ...
0
votes
2answers
106 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. ...
2
votes
1answer
39 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 ...
1
vote
1answer
44 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 ...
0
votes
1answer
74 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 ...