Questions about the use of built-in Mathematica functions, including pure functions.
0
votes
1answer
30 views
Have the kernel load a user-defined function by default [duplicate]
I wrote a very simple function that I would like to act as if it were one of the default functions that came with Mathematica, so that you don't have to load or import any package before you make use ...
6
votes
1answer
62 views
create function that behaves like continuedFraction [duplicate]
I'm just starting to learn Mathematica and I got stuck at this question. This a noob question but please help.
I need to define a function named continuedFraction that takes user input of type list ...
17
votes
3answers
272 views
Why is there no PositionFunction in Mathematica?
Too often I have seen the programs of inexperienced users greatly slowed by using Position in an iterative fashion, when far faster would have been to compute a ...
2
votes
2answers
72 views
Function returning Null along with other unexpected expressions
When I use some function, at the end along with the output I get some NULLs returned that I don't understand the reason for and are highly undesirable.
For example, when I define the reversal of list ...
1
vote
0answers
45 views
Does Graphics`Mesh`SimplePolygonQ[] work for you?
Graphics`Mesh`SimplePolygonQ is an undocumented function. I'm using Mathematica 7, and when I try:
...
2
votes
4answers
145 views
How can I create a list of functions?
Can anyone tell me, how to create a list of functions? I've tried the following code, but it doesn't work.
...
2
votes
1answer
61 views
Flat function with repeated sequence
There are functions like Join[ ] that accept a variable number of arguments. Join is a flat function, as the order of arguments ...
0
votes
1answer
60 views
What does Binomial return for non-integer arguments?
Mathematica returns values for non-integer arguments passed to Binomial.
What is the definition of Binomial for such continuous ...
7
votes
1answer
53 views
Creating a NearestFunction that returns an index
I use Nearest repeatedly for large data sets. For example
pts = RandomReal[{-1, 1}, {1000, 3}];
Nearest[pts, {0, 0, 0}]
I ...
3
votes
0answers
78 views
Mathlink and multithreading
In order to make my computations faster I have developed a C/C++ application calling Mathematica kernel and performing many operations using Mathematica functions for equation solving.
Now I want to ...
24
votes
2answers
410 views
Variable naming changes everything
I am having a rather unusual problem I do not understand with Mathematica where renaming one of the variables of my function causes the function to stop "working". Here is the example of the code ...
2
votes
1answer
115 views
0
votes
1answer
71 views
Taking derivative of Euler relation [closed]
I have defined the following function, which is the Euler relation for $\cos\,x$.
f[x_] := 1/2*(Exp[I*k*x] + Exp[-I*k*x ] )
I want to take the derivative with ...
8
votes
1answer
110 views
Apply a Function Pairwise
I'm new to Mathematica
I'd like to apply Mean pairwise to a list to achieve the following.
...
1
vote
1answer
50 views
How to send a function definition to MathLink from C/C++?
In this tutorial some MathLink concepts are introduced. At page 33 in the last lines the author is talking about sending to MathLink a function definition like ...
2
votes
2answers
87 views
Cannot call custom function loaded from script using C/C++ MathLink
I am using MathLink with C/C++ on a Unix system in order to call a Mathematica (version 9) function and get the result.
The function I need to call is a personal function of mine ...
0
votes
0answers
14 views
Dumb question, how do I find the image of this function? [migrated]
The function is $Y=2$, the domain is just 2? And the image of it?
I don't think I quiet understand what the image of a function means, the domain is all values that it can assume, correct?
Could you ...
6
votes
1answer
89 views
How does `LongestCommonSubsequence` work?
When I recently came across this posting about LongestCommonSubsequence I was curious about how the function worked.
...
9
votes
2answers
90 views
What are Root objects with multiple polynomials?
In Mathematica 9 a new flavor of Root object with multiple polynomials was introduced. For example,
...
5
votes
1answer
73 views
How do I expand StirlingS2[n, 10] in terms of elementary functions?
I know that it is possible to expand StirlingS2[n, 10] in terms of elementary functions of n. I tried ...
0
votes
0answers
4 views
What does “-2E-07x” means? [migrated]
I'm a programmer who had always been lacking some mathematical skills, yes it's a shame, I know.
I'm making this little software for a biologist friend, and at some point I need to pull out a graph ...
1
vote
1answer
74 views
Finding n-th term of a sequence of functions
Lets say, I have the following series of functions,
$f_1=a+1$
$f_2=a^2+2a+1$
$f_3=a^3+3a^2+3a+1$
Assume that $f_4, f_5,$ and $f_6$ are also known. However $f_n$ is not known as a function of $n$.
...
7
votes
1answer
118 views
How do I get a general form for n-th derivative of a function? [duplicate]
I tried the following but it basically returns unevaluated:
...
1
vote
0answers
76 views
Notebook UI: Autocompletion - Display function arguments when typing?
Is there a setting to display the required arguments of a function when typing as Visual Studio, Matlab, etc. does?
2
votes
1answer
73 views
Cannot run Mathematica C-interfacing examples 'factor'
I am trying to run a Mathematica example concerning Mathematica interfacing issues with C programs. In particular I am trying to call a Mathematica function from C.
Example ...
0
votes
1answer
48 views
Don't pollute outside context when solving equation from the outside
This code works fine only if a is not defined in the outside context:
...
1
vote
2answers
62 views
Calling blank arguments using enclosing functions
Is there a way to call a function and have that function use an argument defined in an enclosing function?
e.g.,
...
1
vote
1answer
80 views
Mathematica plots a discontinuity in piecewise function that does not exist [duplicate]
I have the following function defined:
...
8
votes
1answer
216 views
Write C/C++ programs calling Mathematica functions
I need to write a C/C++ program and call some functions in Mathematica especially those like Solve or NDSolve. The problem is ...
3
votes
2answers
56 views
Generating a list of pure variables
I want to pass a list of pure variables to a function, in which the ordering of the variables matters. For instance, if I want a palindrome, my function might be:
...
1
vote
2answers
198 views
distance between two curves
I try to compute the distance between two curves. I use the EuclideanDistance to do that.
Here my code:
...
0
votes
1answer
78 views
Can Mathematica check if two expressions give the same output for integer input?
Let me give the background for this question. I'm using WebAssign to assign homework problems, and WebAssign has a built-in mechanism which can grade problems using Mathematica commands. For ...
0
votes
1answer
63 views
Can I force a function to quit and return some value after a certain amount of time has passed during its evaluation?
Imagine I provide some random input to function like FindInstance[], and I observe that, despite the existence of good solutions, the function will, with some ...
0
votes
1answer
115 views
How do I define the domain of a function?
I have a function of two variables, f[x_, y_], and I would like to restrict the domain to values of x and ...
-1
votes
3answers
198 views
Sqrt — how to get negative branch?
One of the many attractions of Mathematica is that integers are generally treated as exact symbolic entities, and not just as numbers. I was just playing with Sqrt, and was puzzled by what appeared to ...
3
votes
3answers
192 views
How to sum over a List
list = {11.5575, 11.397, 5.52734, 4.0878, 2.54815, 1.86652, 2.55028,
2.14952, 1.6242, 1.34117}
I have a list of numbers. How do I make a function that creates a ...
0
votes
1answer
71 views
Using undefined function in an expression
I want to use undefined functions in expressions to be simplified. For example.
I want mathematica to simplify this input
$(f^{\prime\prime}(t),g^{\prime\prime}(t))\cdot (-g^\prime(t),f^\prime(t)) $
...
1
vote
1answer
98 views
3D plot of two 2D functions
I would like to plot two 2d functions in a 3d coordinate system. Examples are z = x^2 and z = y^2. Each function has one ...
-1
votes
0answers
56 views
Why is NonlinearModelFit calling the model function with symbolic arguments?
I have a model to fit which is made of numerical functions and so it can give a value for any numerical value of the arguments, but creates an error when called with symbols. ...
2
votes
2answers
68 views
changing a symbol into a function variable
Struggled for a while on this problem and hopefully you can help... I have a mathematical expression that currently has a symbol where I used to have a function variable. How do I make the symbol ...
0
votes
0answers
26 views
How does Plot evaluate its argument? [duplicate]
I have a list of about twenty InterpolatingFunctions that I'd like to plot. They are interpolations from experimental data (frequency spectra between 100 and 5000 ...
1
vote
1answer
100 views
Plotting a complex function [duplicate]
What does it mean if this message appears:
{Im[(1-E^Times[<<3>>] f)/(1-Power[<<2>>] f)]-0,Im[(1-E^Times[<<3>>] f)/(1-Power[<<2>>] f)]-0} must be a list of equalities or ...
5
votes
5answers
299 views
Series expansion in terms of Hermite polynomials
I am trying to expand a polynomial in terms of orthogonal polynomials (in my case, Hermite). Maple has a nice built-in function for this, ChangeBasis.
Is there a ...
8
votes
4answers
198 views
Transform a list of functions to a composition
How do I apply a list of functions in a nested way?
Example:
functionList = {f1,f2,f3}
RequiredCommand[functionList,Pi]
such that the required command returns
...
2
votes
1answer
73 views
0
votes
0answers
61 views
FindMaximum inconsistency
The code below seems to work for n<11. But for n=11, and above, it outputs newa then just outputs "beep" sound.
WhyTheBeep says "The kernel Local has quit ...
-1
votes
1answer
87 views
Should Read[] not close its Stream? [closed]
I read a record from a file.
Read[file,Record];
It reads and opens a stream.
Should Read not close its stream after ...
2
votes
3answers
115 views
Alternative to using global variables in functions?
Often times I find myself using unevaluated variables (i.e. they show up blue) as dummy variables in whatever I'm returning such that I can evaluate them as needed later on.
A simple example is as ...
12
votes
3answers
237 views
Accessing list elements by name
First, a bit of a long introduction to my problem:
I only have a few weeks of Mathematica experience. I am creating a mathematica application that calculates some material properties of steel based ...
2
votes
0answers
97 views
Is there documentation on the comparative performance of Mathematica functions?
Recently I have been solving some Project Euler problems. I find there are always several ways to do the same thing. For example, one could join two lists like this:
...



