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

learn more… | top users | synonyms

0
votes
0answers
37 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
76 views

Creating Function with String Input

I am trying to create a function that needs to transform the input into a string. The objective is transforming a latex input into a calculable mathematica expression. ...
0
votes
1answer
30 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
40 views

Gaussian Pulse Fitting with N pulses

Im in way over my head here and am fully aware of it, and hoping for some help. I've been assigned to a project where I am given data: Smooth it with a moving median: and then need to find ...
0
votes
0answers
44 views

being a function in a multiple steps and using syntax for being shortened [on hold]

My desire is to access to a table with the bellow construction: Table[desired[t], {t, 0, 2, 0.1}] For achieve to desired[t] ...
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: ...
2
votes
2answers
293 views

Writing a function that returns a (usable) function

I am trying to create a function that returns Arnold's Cat Map of size n iterated k times. I can get something out of the Function command, but I can't figure out ...
0
votes
1answer
60 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
84 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 ...
21
votes
1answer
504 views

Shorter syntax for Fold and FoldList?

I find it tedious to write out the following: a = {1, 2, 3, 4}; Fold[f, First @ a, Rest @ a] f[f[f[1, 2], 3], 4] It ...
4
votes
1answer
69 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?
4
votes
0answers
76 views
0
votes
1answer
76 views

How to efficiently compile this function? It involves a 3-index Table [on hold]

Consider a 2-dimensional lattice with LxL sites. Each site has 4 neighbors, and we can then define a function (called below ...
0
votes
2answers
31 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
113 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 ...
-1
votes
0answers
26 views

How to compare strings insensitive? [closed]

To compare str1 with str2 I would do StringMatchQ[str1, str2] What if I want the ...
0
votes
0answers
42 views

How to express $f(x,y) = u(x,y) + i\, v(x,y)$ as $f(z)$ [closed]

The $f(x,y)$ is actually a series with complex parts. I'd prefer not working this out by hand.
0
votes
0answers
168 views

Why does my calculation of a probability take too much time?

I am calculating the value of the following function for given argument values: ...
-1
votes
0answers
54 views

How to make async functions? [closed]

Considering we have two functions func1 and func2: func1 func2 How can I make ...
2
votes
1answer
173 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 ...
0
votes
2answers
104 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. ...
1
vote
1answer
62 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 -> ...
3
votes
1answer
196 views

Fixed-Point Numbers in Mathematica

I am working with a library that needs input in a Fixed Point notation. I’d like to figure out a way to convert the floating point results into fixed point representation. The fixed point length is ...
7
votes
5answers
302 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: ...
2
votes
2answers
183 views

Permanently rounding numbers/values to a given number of significant figures

I am searching for a simple way of rounding and setting an input to a desired number of significant figures. There are a vast number of posts that discuss similar problems, but none address this ...
0
votes
0answers
19 views
2
votes
0answers
48 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
34 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. ...
1
vote
3answers
57 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
75 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
58 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: ...
3
votes
1answer
92 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 ...
5
votes
1answer
148 views

Can Mathematica Operators be combined in a linear fashion for readability? [duplicate]

Here's a simple example. Suppose we want to find the off-diagonal matrix of m: m={{1,2},{3,4}} This can be solved fairly simply by extracting a list of the ...
2
votes
1answer
281 views

Smoothing a single rectangular pulse in NDSolve

Hello I am interested in smoothing out the sharp edges of a single rectangular wave centered at the origin. I am looking for a smooth function that looks almost exactly the same as the square wave ...
12
votes
1answer
239 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. ...
14
votes
1answer
149 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 ...
2
votes
4answers
743 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 ...
1
vote
1answer
36 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). ...
-1
votes
1answer
55 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 ...
4
votes
0answers
48 views

NotebookWrite a Cell with WholeCellGroupOpener option

Why NotebookWrite[ EvaluationNotebook[], Cell["ZZ", "Section", WholeCellGroupOpener -> True] ] produces: ...
1
vote
1answer
81 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 ...
2
votes
2answers
88 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
81 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. ...
-1
votes
1answer
212 views

Some Problem with WhenEvent! [closed]

Anyone knows what's the problem with the following code and how can I fix it? I am not sure that I wrote the WhenEvent section correctly. By the way, I want to solve the equations and then plot y vs. ...
1
vote
2answers
46 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
163 views

Manipulate - Evaluating Value of Function

I would like to visualize the properties of a threshold, which is a value of a function. Unfortunately, the value is expressed as scientific value (an approximation with 3-5 decimals would be fine) ...
1
vote
1answer
39 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
3answers
128 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
1answer
56 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. ...