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

learn more… | top users | synonyms

1
vote
1answer
44 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 ...
0
votes
0answers
38 views

Autocorrelation issue [on hold]

I am analysing time series and want to know if it is autocorrelated. I use AutocorrelationTest[data, 1] and get The data contains ...
0
votes
0answers
34 views

Plotting function with small values in Mathematica [on hold]

I've got an issue in Mathematica, just can't figure it out, I've looked on any reference I have available. I am doing something basic, need to plot two functions together. However, my plot shows ...
4
votes
2answers
450 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
182 views

Why doesn't this pattern work? [on hold]

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
55 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
65 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
65 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
132 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
479 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
3answers
59 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: ...
5
votes
3answers
95 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
34 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
29 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
87 views

CoefficientRules for negative powers

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

Mathematica doesn't simplify a simple expression

The question is simple as that. I have: ...
0
votes
0answers
40 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
22 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
148 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
59 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 ...
19
votes
3answers
912 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
218 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
277 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. ;)
3
votes
1answer
115 views

How do I format Compile[] correctly?

My Mathematica skill is still rusty, so kindly bear with me. I'm having problem formatting expression to compile the function correctly: $\sum _{g=1}^G \sum ...
13
votes
3answers
568 views

Fitting ellipse to 5 given points on the plane

Five points are required to define a unique ellipse. An ellipse has five degrees of freedom: the $x$ and $y$ coordinates of each focus, and the sum of the distance from each focus to a point on the ...
2
votes
3answers
106 views

Function to Expand exponentials

Is there a function similar to PowerExpand which expand exponentials? This would, for example, take Exp[5(a + b)] and ...
6
votes
2answers
99 views

Modifying parameters: Set::setps in the part assignment is not a symbol [duplicate]

Ok, this will probably be a silly question, but I can't get my head around it. I'm making a simple module that, given a list and two integers, will swap the position of the elements in the ...
2
votes
1answer
62 views

JordanDecomposition in Mathematica

I'm trying to find the Jordan Decomposition in Mathematica for $$ A=\left( \begin{matrix} 2& -5& 8&-12\\ 1& -2& 4&-8\\ 0&0&2&-5\\ 0&0&1&-2 \end{matrix} ...
-1
votes
1answer
80 views

Similarity of two plot to each other [closed]

I want get the similarity of two different plot by Percent ... I have many plots for comparison like below : y : ...
5
votes
2answers
138 views

Biot-Savart Law/Magnetostatics Solution

I am working on solving the Biot-Savart Law equation for the magnetic field around a charged ring of uniform current density. The expression that Mathematica gives is rather nasty, as expected. Notice ...
6
votes
5answers
370 views

Find function inverse

I'm trying to find the inverse of a function: (30*x^2 (1 - x)^2) (* where 0<x<1 *) I tried all the following options: 1. ...
1
vote
2answers
92 views

How to explain NDSolve that functions must be positive only?

I have a simple system of differential equations to solve but both functions should be positive: x[t] > 0 and y[t] > 0 for all t. I was not able to explain NDSolve this fact so it goes x[t] < 0 ...
2
votes
1answer
97 views

Ted's explanation for the 3rd argument of ListCorrelate doesn't apply to the {1, -1} case?

I was reading Ted Ersek's explanation for the usage of ListCorrelate(.nb version can be found here) and noticed something confusing. It's the third example of ...
-1
votes
1answer
21 views

Iterator bounds error when defining function [closed]

It's been a while since I've done any multi-line functions in Mathematica, so maybe I'm just missing something. I've created the following function, and I immediately get an Iterator bounds error when ...
4
votes
1answer
73 views

Possible bug / numerical issues with HypergeometricU — any suggestions for a fast workaround?

I've encountered some problematic behaviour with HypergeometricU. I have a probability distribution on the positive integers that takes the following form after ...
11
votes
2answers
203 views

Extracting the function from InterpolatingFunction object

I've used Interpolation[] to generate an InterpolatingFunction object from a list of integers. ...
1
vote
0answers
52 views

Inconsistent linearity of inverse Fourier transform

Bug introduced in 8.0.4 or earlier and fixed in 9.0.1 or earlier I am trying to compute the inverse Fourier transform of this expression ...
2
votes
1answer
62 views

Find constants in a function? [closed]

Let's say I have a function f[x] with n constants, e.g. f[x] = c1 * x + c2*x^2 + ... + cn *x^n I also have n conditions to find those constants, e.g ...
0
votes
0answers
131 views

Defining a Gaussian Distribution Fit to data [on hold]

I am given a set of data and told ahead of time that the data will need to be fitted to a Gaussian Distribution. I know that Mathematica has preset functions for linear, quadratic, and cubic fits, but ...
1
vote
1answer
106 views

StreamPlot in Mathematica

A $2\times 2$ linear ODE system can be visualized by StreamPlot in Mathematica. For example: ...
4
votes
0answers
156 views

Strange behaviour of MMA in derivatives of some standard functions

There are some peculiar things to be discovered in derivatives of some standard functions in MMA: Strange behaviour Example 1: Abs We have ...
3
votes
0answers
57 views

Listable on first level

I have some function which take List as input. f[l_List]:=someActions[l] I need apply this function to a list of lists. Now I ...
1
vote
1answer
39 views

Strange behaviour of Set and Part when given a sequence

Consider this example: lis1 = {a, b, c}; lis1[[2]] = Sequence[e, f]; lis1 (*{a, e, f, c}*) lis1[[2]] (*e*) lis1[[2]] = Sequence[g, h]; lis1 (*{a, g, h, c}*) It ...