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

learn more… | top users | synonyms

3
votes
2answers
668 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
649 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
248 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: ...
1
vote
1answer
262 views

Mapping and Interpolation

Does Mathematica have a mapping function like scipy or any of the multidimensional ones? By this I mean something like mapping $[1,100]$ onto $[7,20]$ for example. Looking at Interpolate I only ...
12
votes
1answer
333 views

Function as an option to a function

I am new to mathematica ,so this question may seem a little naive. I know how to use the option as an argument to a function, we can define an option by using ...
9
votes
1answer
452 views

GeoDirection and GeoDistance Memory Leaks: How to Recover the Memory?

The functions GeoDirection and GeoDistance have memory leaks. To see this, run the example functions below and watch as the Physical Memory Available in the Windows Task Manager, Performance tab, ...
4
votes
1answer
260 views

How do I use the result of Solve in a function definition?

I'm trying to adapt the following piece to the part where PowerF is a function of amax. ...
7
votes
3answers
307 views

Why can't D[] be used in place here? [duplicate]

Possible Duplicate: General::ivar is not a valid variable when plotting - what actually causes this and how to avoid it? Beginner question: Why can't I use ...
7
votes
3answers
457 views

How to create a list of pre-defined functions?

I would like to create a list of Cauchy distribution pdf's, having different locations of their maxima, and being multiplied by different factors; then I'd like to calculate those functions' values ...
7
votes
2answers
466 views

Function Interpolation with Automatic / Algorithmic Values Mesh

I have an underlying function f(x,y,z) that is computationally intensive, but is smooth and continuous. I'm needing to find the function values along a line in xyz. Currently, I'm calculating f at ...
2
votes
4answers
5k views

Calling Correct Function for Plotting DiracDelta

I am wondering what is the correct function in Mathematica to plot the true impulse function, better known as the DiracDelta[] function. When using this inside of a ...
10
votes
3answers
287 views

How to “ignore” an element of Map or MapIndexed

Say I have some function that I'm applying every element in a list to... if that element matches some criteria: ...
35
votes
2answers
4k views

What is so special about Prime?

When we try to evaluate Prime on big numbers (e.g. 10^13) we encounter the following issue : ...
23
votes
2answers
759 views

Block attributes of Equal

I answered “Equating matrices (or higher order tensors) element-wise” with: ...
2
votes
2answers
396 views

Cannot evaluate differential in Mathematica

I have a small toy script in Mathematica that I am trying to use to evaluate the pdf of $Y$ where $Y=X^2$, and $X$ is uniformly distributed in $[0,a]$. The script is, ...
10
votes
2answers
426 views

How to test if optional argument has been given?

I understand that the last call (f[1]) returns True because arg does not exist and thus ...
3
votes
7answers
737 views

Defining an integer-valued function on an integer domain

This should be an easy question! I want to define a function with domain = the 12 integers {1,12}, with the values f[1]=31, ...
4
votes
3answers
309 views

How to cancel floating point factors?

I am currently having problems with some floating points. I have a function, which gives as an intermediate result (for example) ...
9
votes
3answers
345 views

Problem when defining variable in Mathematica

I'm trying to run this: domain := {n, 0, 10}; Plot[n, domain] but it doesn't work. Instead, it generates the message ...
15
votes
6answers
1k views

Max of a table/list with indeterminate values

Suppose I have a Table: tab = {1., 2., 3., Indeterminate} When I type Max[tab] I get ...
8
votes
3answers
556 views

Inverting a function in a certain region

InverseFunction works well for globally invertible functions, like f = 2*# + 2 &; InverseFunction[f] ...
11
votes
2answers
820 views

How do I find the elements in a list that return the highest value for a function?

Suppose we have a list of values and a function f. I want to find which of the elements maximizes the return value of the function in Mathematica. Let call the ...
7
votes
2answers
2k views

Series of piecewise functions

Let $f_{0}(x):[0,1]\to[0,1]$ be defined by $$f_{0}(x):=\begin{cases} 3x, & \text{if } x\in [0,\frac{1}{3}] \\ \\ -3x+2, & \text{if } x\in (\frac{1}{3}, \frac{2}{3}] \\ \\ 3x+2, & ...
15
votes
3answers
628 views

Can someone explain this snippet: (#[#] &)[#[#][#] &]

A friend showed me this snippet of code today: (#[#] &)[#[#][#] &] I can sort of see that we're constructing an anonymous function that takes a function ...
2
votes
1answer
1k views

Function that takes another function inside

Looking at this QA, I'm trying the following - 2 functions (r in vector format) using Theta { A, 2 } functions (sorry for the inconsistent names...). ...
16
votes
3answers
2k views

Plotting piecewise function with distinct colors in each section

I have a piecewise function that I would like to plot but I was wondering if it is possible that each part of the function that is plotted when its corresponding condition is true be plotted with a ...
7
votes
3answers
321 views

Making sure that Timing[] isn't thrown off by caching

In playing with and comparing the various answers to my question here, I tried applying Timing[] to see how fast things ran, but it seemed that some of the answers ...
69
votes
6answers
6k views

List of compilable functions

Is there somewhere a list on the functions that Compile can compile, or the cases in which a particular function can be compiled that I haven't found? I'd be glad ...
14
votes
5answers
2k views

sprintf() or close equivalent, or re-implementation?

Is there a sprintf() command (some command that takes a printf-style format string and a list of values to insert into the ...
25
votes
5answers
1k views

Are there “All” and “Any” functions in Mathematica?

In Python, there is a function all which returns true if all of its arguments are true, and any which returns true if at least ...
10
votes
2answers
600 views

How to add an interpolating point to InterpolatingFunction?

Suppose I have an InterpolatingFunction object defined on $[\epsilon,1]$; let's call it f. What is the best way to construct a ...
12
votes
1answer
931 views

Error checking and trapping techniques with Throw and Catch

Mathematica provides several mechanisms for checking arguments and trapping errors in a function definition. Typical methods are : Definitions with argument patterns, definitions with ...
12
votes
1answer
12k views

How to express trigonometric equation in terms of of given trigonometric function?

How can I express a trigonometric equation / identity in terms of a given trigonometric function? using following trigonometric identities ...
10
votes
9answers
518 views

How to find range in which a number falls, from given list of numbers?

How can one find the range in which a number falls, from given list of numbers? ...
7
votes
2answers
265 views

What's the purpose of the Unique function?

As the title says: What's the purpose of Unique? I understand that it generates some unique symbol, but when and for what is it to be used? Are there applications ...
53
votes
2answers
2k views

Flatten command: matrix as second argument

One thing I could never wrap my head around is how Flatten works when provided with a matrix as the second argument, and the Mathematica help isn't particularly ...
11
votes
1answer
213 views

Choosing among different function definitions without sacrificing speed

I'm working on some code that numerically integrates a function, let's call it G, which calls another function, F, that can be ...
58
votes
3answers
1k views

Automatically generating a dependency graph of an arbitrary Mathematica function?

Has anyone written a function to pull the function dependencies of a function? That is, it would be nice to have a function that returns a list of function dependencies as a set of rules, terminating ...