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

learn more… | top users | synonyms

3
votes
2answers
310 views

What is the command to find function invariant?

What is the command to find function invariant? http://demonstrations.wolfram.com/AFunctionInvariantUnderAGroupOfTransformations/ what is algorithm it use to calculate this? Edit there is a book ...
2
votes
2answers
144 views

Custom function not returning any output

I'm trying to write a custom function but it isn't returning any output. Here's my code so far: ...
7
votes
2answers
1k views

How to create a rectangle wave (duty cycle $\ne$ 50 %)?

I'm trying to use phase-shifted SquareWave[] functions to create a rectangle wave: ...
2
votes
2answers
392 views

decompose a number (less than 255) in a sum of powers of 2

Is there a built in function that would take a number and decompose it into a sum of powers of 2? The numbers will be non negative less than 256. For what it's worth I'm trying to understand a paper ...
5
votes
1answer
125 views

How to make the Show function work in this case?

I can't get this to work, the Show function shows only the first plot. Why this happens and how to solve it? Show[Plot[x^2, {x, 2, 10}], Plot[1 - x, {x, 1, -10}]] ...
2
votes
2answers
389 views

Conditions for Piecewise[ ] Command

I am trying to plot a function in which is piecewise defined. I found the Fourier coefficients of this, and my question is how to define even & ...
6
votes
1answer
444 views

Evaluate continued fraction

Mathematica has the ContinuedFraction[] function to give the continued fraction expansion of a rational (or approximation of a real) number. I'm interested in the ...
7
votes
2answers
190 views

Why does Solve and Sum give different answers when according to Table it is the same sequence?

I have been thinking about a piece of code today, but I don't understand why I get different outputs from two in my mind similar Mathematical sums. First I observe that the Table command for this: ...
2
votes
3answers
429 views

Output of plots from within Do[ ] Command

I am wondering why the following does not plot the way it's written and exactly how does the Do[] function operate? I think I could be using it incorrectly. ...
8
votes
1answer
721 views

(Non-Convex) Polygon Union and Intersection Functions [duplicate]

Possible Duplicate: Intersecting graphics Back in 2009 I posted a question in comp.soft-sys.math.mathematica looking for a function which generates the union of two (not necessarily convex) ...
2
votes
3answers
161 views

Using Nest inside NestList

I need results like this: {Cos[Cos[x]], Sin[Cos[Cos[x]]],Cos[Cos[Sin[Cos[Cos[x]]]]], Sin[Cos[Cos[Sin[Cos[Cos[x]]]]]], ... } I've tried to use ...
13
votes
3answers
275 views

How to keep some of the results of the NestList

I'm using some iterative arithmetics to calculate wave propagation with the help of NestList. I have to use a small step size for iteration to guarantee the accuracy, which lead to too much data (e.g, ...
10
votes
1answer
196 views

How to pass composite function list to SortBy?

In order to sort alphanumeric-as-string data of the form {"T3", "T14", "T1", "E2"}, so that "T14" comes after ...
2
votes
3answers
197 views

Ways to change an explicit function into a pure function

I'm trying to use FixedPoint to solve a transcendental equations, but the first argument of the FixedPoint should be a pure ...
5
votes
1answer
121 views

RankedMax and Max do not behave identically

I have spent three hours debugging some code and at the end I think I found a bug. Otherwise I cannot explain what I am seeing: When I want to use RankedMax on ...
1
vote
3answers
2k views

How to write values of function to file?

For example, say I wanted to plot Sin(x) like this: Plot[Sin[x],{x,0,2 Pi}] But instead of plotting to a graph, I want to now tabulate the values of Sin[x] to a ...
6
votes
4answers
280 views

Why does my function defined with constraints on patterns not work? [duplicate]

Possible Duplicate: Why doesn't PatternTest work with Composition? My function is something like this, ...
6
votes
5answers
282 views

Is it possible to insert arguments into functions when they're used like Function@ or //Function?

Is it possible to insert arguments into functions when they're used like Function@ or //Function? Sometimes I need to do this, but then I have to return to the standard function usage: Function[] ...
10
votes
2answers
870 views

Converting ConditionalExpression to Piecewise

I have Solve[] return a list like ...
7
votes
0answers
174 views

What Method options does FindInstance accept?

While answering Trouble getting FindInstance to return multiple results for certain constraints it became clear that for this problem FindInstance would be better ...
-3
votes
1answer
643 views

How to find the maximum value and the argument of a function of three variables y dividing into grids?

I am dealing with a non-linear function of three variables, namely R0k, R1 and alpha. To find its maximum value, I divided the three variables into grids and maximized the function by plotting the ...
8
votes
2answers
649 views

What is the Mathematica equivalent for the Excel function tinv()?

TINV() returns the t-value of the Student's t-distribution as a function of the probability and the degrees of freedom. For example ...
12
votes
3answers
471 views

How to make the suggestion box appear?

When you type a function in Matlab, quickly a suggestion box comes up showing functions similar to the one you're typing. I thought that Mathematica didn't have this but one day, I typed half of a ...
6
votes
2answers
259 views

How to choose variables from a list for a function and then use the solution in a subsequent function?

I am trying to calculate heating degree days and cooling degree days and output that information to a table. I am using mathematica's curated data to do this. In text this is what I would like to ...
9
votes
1answer
296 views

Defining Tags in Reap

I am trying to use Sow/Reap to replace Append in my code. The problem is that I need to ...
5
votes
1answer
626 views

Nesting multiple functions of multiple variables

I was wondering how one would go about nesting multiple functions of, say, two variables. The problem comes from trying to implement the Chirikov standard map without using "for" cycles. I found a ...
8
votes
1answer
649 views

How can you use and convert Gauss-Krüger-Coordinates in Mathematica?

I am given geographic data in the form of Gauss-Krüger-Coordinates and would like to calculate distances with them and convert them to longitude/latitude coordinates in another system for plotting ...
7
votes
1answer
326 views

LogLikelihood function from the Time Series package is apparently missing

The Time Series package for Mathematica comes with a function called LogLikelihood. It is discussed and used extensively in the documentation (pdf). So does ...
3
votes
5answers
493 views

How to use summation to get the value of a binary number?

How to use summation to get the value of a binary number? I want to do this: $(x_{n}x_{n-1}...x_{0})=\sum_{i=0}^{n}x_{i}\cdot b^{i} $ But it seems that I can only do something like this: ...
20
votes
2answers
1k views

Implementing continuous phase/Arg function

In MATLAB there's a function called phase that is just like our Listable friend Arg, but ...
-1
votes
1answer
380 views

inverse function not working — but providing values for some arguments, a symbol otherwise?

Could you help me with what Mathematica is doing here, in the last lines? (The rest is here for context.) I removed the output to let you simply run this. Thanks. ...
5
votes
1answer
223 views

Can we know the background code associated with basic mathematica functions

I wanted to know how computers calculate basic functions like Sqrt so first I checked how humans do it I found that they use something called "Newton's method" that ...
9
votes
1answer
1k views

Using RegionFunction on multiple plots

I realize that the Plot function can plot multiple functions of x at the same time, using { }. I also know that the ...
19
votes
3answers
936 views

How to load a package without naming conflicts?

This question applies to any package, but I encountered this problem while working with graphs. There are symbols in the Combinatorica package (such as ...
7
votes
3answers
808 views

How do I plot Thomae's function in Mathematica?

I wanted to plot this function $$f(x) =\begin{cases} 1 & \text{if } x= 0 \\ \tfrac1{q} & \text{if } x = \tfrac{p}{q}\\ 0 & \text{if } x \in \mathbb{R}-\mathbb{Q} ...
13
votes
3answers
454 views

Is it possible to get the order of inputs when “overloading” an orderless function?

When working with symbolic matrix operations or other objects which don't have commutative multiplication, it would be nice to not have to constantly switch out times for ...
10
votes
2answers
103 views

Functions in a different context are replaced with infix forms of their namesake in System`

So, in an attempt to help out Fabian with his question, I did what I often do, and created a new symbol in the Pillsy` package that I could play with. Since it was ...
21
votes
3answers
435 views

Is there a bug in Pick?

I wanted to use the Pick function with a condition. But there seems to be an issue here. Take a look at this: ...
5
votes
2answers
308 views

How to find Matano plane

I have discrete collection of data points (10 to 10^4). I want to describe them by a continuous function and find a x value z, ...
6
votes
2answers
615 views

Why does Expand not work within a function?

I'm writing this fairly simple function: ...
3
votes
2answers
196 views

How to use ForAll in Reduce

I was wondering: how does one use the ForAll function in Reduce? In particular, I am looking for the set $\{w\in \mathbb{R}^2 | ...
11
votes
1answer
244 views

What's a good style for inheriting Options[] of built-in function?

Options[myPlot] = Options[Plot]; myPlot[args___] := ... When defining a "wrapper" function like the above, I'd like it to inherit the ...
4
votes
1answer
166 views

Create string from character code

Is it possible to convert a charcode/keycode to a string? I want to do this to create variables in a generated equation.
3
votes
4answers
1k views

How to convert binary float to decimal float

I need to convert binary float to decimal float in Mathematica, ideally between any two bases. FromDigits["1.111111", 2] does not work.
5
votes
0answers
70 views

Graph relationships between functions and variables [duplicate]

Possible Duplicate: Has anyone written any function to automatically build a dependency graph of an arbitrary Mathematica function? I need to make sense out of a huge notebook (17Kloc) ...
9
votes
1answer
223 views

What default theoretical distribution does Mathematica use in PearsonChiSquareTest?

I used Mathematica's function PearsonChiSquareTest to test whether the data were drawn from a normal distribution. As in the reference, I expected Mathematica to compare the result to a normal ...
3
votes
2answers
628 views

Is there a function to calculate studentized range?

Is there a built-in function for studentized range or do I have to build it myself? Is there a test of normality for the studentized range?
10
votes
1answer
627 views

Growth of functions

Does somebody know if Mathematica can be used to calculate the growth of functions, that is in Big O, Theta, and Omega and find proper $n_{0}$ and $c_{1}$, $c_{2}$ respectively?
3
votes
1answer
239 views

FunctionInterpolation Errors / Question re Evaluation Order and Options

I have using Mathematica functions that takes a Cartesian coordinate relative to the Earth (xyz) and converts it to a latitude, longitude, and altitude (lla). And here it is: ...
6
votes
4answers
2k views

Plotting a simple relationship with Plot[] results in empty graph

I've moved this question over from StackExchange to get better visibility (and deleted the old question). I have a user-defined relationship I'd like to plot: ...