Tagged Questions

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

learn more… | top users | synonyms

0
votes
0answers
22 views

Should this be equal to Gamma function or not?

I define the following function: Nat2[s_] := InverseFourierTransform[FourierTransform[1/t, t, w] (-I w)^(s - 1), w, x]/Cos[Pi (s - 1)] /. x -> 1 I expected ...
6
votes
0answers
112 views

Why does the documentation call functions “pure”?

Clearly, functions in mathematica are not pure functions according to the definition on Wikipedia (no side effects - basically implementabe with table lookups): ...
1
vote
0answers
38 views

Does mathematica have “Realized Covariance” function?

Does mathematica have "Realized Covariance" function? I see that the function called "CovarianceFunction" may be a little close to this, but it is not so easy to see the actual "realized" property ...
1
vote
1answer
67 views

handling division by zeros and line equations

today I was writing a code which takes some line equation and a circle equation,finds intersection points that are on $II$ and $III$ quadrants,draw a tangent line to circle from that point and then ...
0
votes
0answers
44 views

Empty Graph for Absolute Function

I wanted to plot the following equation: Plot[((x/7)^2 Sqrt[(Abs[Abs[x] - 3]/(Abs[x] - 3))] + (y/ 3)^2 Sqrt[(Abs[y + 3 Sqrt[33]/7])/(y + 3 Sqrt[33]/7)] - 1) (Abs[x/2] - ((3 ...
0
votes
0answers
28 views

Pick out element from array [on hold]

I have the $3\times 3 \times 3$ array: ...
1
vote
1answer
40 views

Multiway Systems Rules List Management

I'm working with a multiway system and I have a number of different mutation rule lists. I need an efficient way of managing which rule lists I apply. Here is the basic multiway system code that I'm ...
1
vote
1answer
64 views

Plotting a function in {X(Y),Y} space

The code below generates some data and defines a function f[x,cb]:=NMaximize[expr,x] that upon being evaluated returns: {function value at max $x$,the function maximizing $x$}. ...
6
votes
2answers
174 views

How to redefine the type of multiplication in Det

I would like to redefine the type of multiplication that is used in Det (calculates the determinant). Instead of the standard multiplication I would like to use a custom function Fun[a,b] (which takes ...
13
votes
1answer
215 views

Why do big-O terms disappear in definite integrals since Mathematica 9?

In Mathematica 8, when I computed the following input: Integrate[Series[Cos[x], {x, 0, 2}], {x, 0, a}] Mathematica returned an expression that had a O[a^4] in ...
1
vote
0answers
34 views

FinancialDerivative function call without parameter fails in Mathematica 10

When I type FinancialDerivative[] in Mathematica 10. There is error listed as follows. Anybody know how to solve it? Thanks.
1
vote
1answer
58 views

User defined functions and decimal places displayed

I have a couple of complicated user-defined functions, one which calls the other, and I wish to control the number of decimal places displayed when I call the "mother" function. I have tried the ...
1
vote
1answer
57 views

In which version was this Extract syntax introduced?

In Mathematica 10.0.1 this works: Extract[{a, b, c, d, e}, {{{1, 3}}, {{5, 4}}, {{2}}}] {{a, c}, {e, d}, {b}} In ...
2
votes
0answers
26 views

Automatically discover the class of an arbitrary matrix

In Wolfram|Alpha it is possible to discover some specific classes to which a matrix belongs. For instance, typing this in Wolfram|Alpha ...
0
votes
0answers
57 views

Birch clustering in Mathematica

I want to implement birch clustering in Mathematica. MAthematica only has 4 methods of clustering, is there any implementation for Birch clustering? Birch clustering is much faster than K means ...
2
votes
0answers
62 views

Distance Time Warp (DTW) function implementation in mathematica

The DTW (Distance time warp) is given here http://en.wikipedia.org/wiki/Dynamic_time_warping There is an implementation of DTW in R as well as MATLAB. However i am unable to find something for DTW in ...
-2
votes
0answers
52 views

Finding the domain of this trigonometric function [migrated]

how can I find the domain of this function? f(x) = (xsin(x) + cos(x) / 1 - cos(x)) + (|X| - 2 / x^2 -4) I assume we don't want the dominator to be zero so f(x)1 ...
0
votes
1answer
23 views

How to rearrange CharacteristicPolynomial[ ] terms?

I have a symbolic matrix A, which I need to find the characteristic polynomial, then order the polynomial in greatest-to-least form. (Ultimately to find the matrix inversion via Cayley-Hamilton ...
2
votes
2answers
42 views

Returning the 3-dimensional vector from a skew symmetric matrix

I'm trying to write a function that takes in a skew symmetric matrix and returns the corresponding vector. When I write the following code, it works when I leave it as variables, but it does not work ...
0
votes
1answer
40 views

How to evaluate a “pure function”? [closed]

I need to evaluate the result of DSolve, e.g. {{y -> Function[{x}, x^2 - x^3]}} at some specific point. I tried y[1] and y /. x -> 1. Hope someone knows how to do it
0
votes
0answers
22 views

Add constraints to a variable number of parameter in Minimize

i want to use Minimize with a variable number of Parameter which works fine: ...
4
votes
2answers
109 views

Can't figure out how to apply these functions repeatedly

I have the following problem, and even though I've tried Fold & Inner, Sow & Reap, et al. I can't figure out the clean way to do this. Here's the problem. I have a list that starts as ...
1
vote
1answer
58 views

C compiler error: the no library could be generated error

I have windows 8, Mathematica 9, and I've just installed Microsoft Visual Studio 2013 with update 3. I'm try to run Compile with the option ...
4
votes
2answers
457 views

How to create a function like in Python

I want to call a function that would perform a function rather than assigning an expression to them. I.e. ...
5
votes
1answer
201 views

Why doesn't this pattern work? [closed]

I want the in-built function Count to count the elements in a list which are greater than a value. Example: Count[{1, 1, 2, 3}, (# > 1.5) &] Why doesn't ...
0
votes
2answers
56 views

How do I get a Do function to create a list?

I have a Do function which gives me a column of expressions. How can I get the Do function to give me these expressions in a list. i.e The do function gives me this: a b c d I would like it do give ...
0
votes
2answers
78 views

Problem in downloading “ToMatLab” package [duplicate]

Iam trying to download "ToMatLab" Package from http://library.wolfram.com/infocenter/MathSource/577/ but it is showing me an error message by showing a big question mark and "File could not be ...
0
votes
1answer
68 views

Functions in functions

I have three functions f(x,y) , g(t) , and h(t) and somehow I have to find (d/dt)f(g(t),h(t)) where t = 0. How would I go about writing this in Mathematica? In this equation g(t) is taking place of x ...
2
votes
3answers
136 views

Extracting coefficients from a power series

I have a function defined explicitly as a power series: $$\sum_{n=0}^\infty{T_n}\frac{x^n}{n!}=\frac{\frac{x^3}{3!}}{e^x-1-x-\frac{x^2}{2!}}$$ and I would like to extract the coefficients $T_k$ as ...
13
votes
6answers
503 views

How can I evaluate only a single step of a recursive function?

Let's say have a simple recursive function for the Fibonacci sequence f[0] := 1 f[1] := 1 f[n_] := f[n - 1] + f[n - 2] but I want to see how it will expand in a ...
2
votes
2answers
62 views

Conditional replace of a column

Im trying to replace the value in the Nth column of a list if a condition is true, returning the modified list. I've tried modifying the answer from 61219 and been through most of related questions ...
0
votes
1answer
51 views

What does this Append expression do? [closed]

I have to understand some code. A part of it is written below. Can someone explain to me what it does: ...
6
votes
3answers
110 views

How to deal with the condition $u_i=u_{i+1}$ in B-Spline basis function?

The defintion of B-Spline basis function as shown below: Let $\vec{U}=\{u_0,u_1,\ldots,u_m\}$ a nondecreasing sequence of real numbers,i.e, $u_i\leq u_{i+1}\quad i=0,1,2\ldots m-1$ $$N_{i,0}(u)= ...
-4
votes
0answers
26 views

How does the Round function work? [duplicate]

I should use the Round function in my code. I am interested in functions like Round[#]. For example how does ...
0
votes
1answer
35 views

Rigging a function to output a distinct value every nth call

There's some fixed script I am unable to alter (keeping things simple: Table[f[i], {i, 1, 10}]), , however, I can alter a function that the script calls (again, ...
0
votes
1answer
31 views

Trouble definining a function to use only certain heads

I'm trying to write a function that accepts only a particular Head (for example, prints only Symbols) using pattern matching. However, the following code has me a bit of confused. ...
4
votes
4answers
88 views

CoefficientRules for negative powers

CoefficientRules acts like the following. ...
4
votes
1answer
222 views

Mathematica doesn't simplify a simple expression

The question is simple as that. I have: ...
0
votes
0answers
41 views

How can I mix // with a function of two arguments? [duplicate]

I often find myself using // when playing around with expressions, but it is always cumbersome to have to switch to the full notation just to apply a function of ...
1
vote
0answers
33 views

Analog of GeneratingFunction for Newton series [duplicate]

GeneratingFunction gives the generating function for Maclauren series. I wonder if there a similar function for Newton series. If $$g(x)=\sum_{k=0}^{\infty}\frac{x^k}{k!}f(k)$$ Then g(x) is ...
1
vote
2answers
69 views

How to define a function that counts the exponents

I want to define a function $F$ described as follows: The input of $F$ is a polynomial such as m*u*x^4*y + n*v*x^2*y^3 where $m$ and $n$ are constants, and ...
1
vote
1answer
23 views

Expand Expression with Nested Special Functions [closed]

I am trying to study the following sequence for $a=1$, $n \ge 1$: $$\alpha_n=(1-aq^{2n})\sum_{j=0}^{n}\frac{(aq;q)_{n+j-1}(-1)^{n-j}q^{\binom{n-j}{2}}}{(q;q)_{n-j}(q;q)_j^3}$$ using Mathematica, where ...
0
votes
2answers
151 views

Time value of Money Functions combined

I am trying to combine multiple functions into one. I have defined following functions: (PV refers to Present value, FV refers to Future value, i or IPER refers to interest per period, pmt refers to ...
1
vote
0answers
29 views

Central binomial coefficient [closed]

I am tasked with creating a recursive definition of the binomial coefficients that stores previously calculated values. this is what I have: ...
0
votes
1answer
60 views

Applying natural log to a table of values [closed]

I know this is a simple question, but I am new to Mathematica. How do I go about natural log to a table of values? I tried this: ...
8
votes
2answers
175 views

Is there a way to revert to the built-in function after overwritting it using Unprotect

When using Unprotect, we can overwrite a functions definition: Unprotect[Sqrt] Sqrt[x_]="blahblah" Protect[Sqrt] Once this is done, can we revert to the built-in ...
20
votes
3answers
929 views

Visualisation of a recursive function

Is there a way to nicely visualize recursive functions? (diagrams/plots) More specifically I'm looking for a way to make contrast (visually) between e.g. the cosine function which if continuously ...
4
votes
5answers
219 views

Replacing columns of a matrix with zeros

I am to create a function that replaces columns 'm' through till 'n' with zeros. Here is what I have so far: ...
2
votes
2answers
280 views

Will Parallelize in this programme help it run faster? [closed]

I have a programme, and inside it this line of code. ...
0
votes
1answer
47 views

How to use “Compile” function when argument is array of size 500? [closed]

How to use "Compile" function when argument is array of size 500? The examples in the Mathematica help is just with one argument belonging to the real numbers. Any help would be appreciated. ;)