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

learn more… | top users | synonyms

1
vote
3answers
778 views

Variables Inside Functions Not Evaluating

x = 5*y function1[y_] := x function1[5] Am I wrong in thinking that function1[5] should equal 25? Instead this comes out. ...
0
votes
2answers
122 views

How to obtain a smaller-sized output from Solve

I am solving a system of 15 simultaneous linear equations using Solve. On running the code, I get a message saying "A very large output was generated" with options ...
0
votes
1answer
122 views

Why am I not getting Indeterminate for f[1] when f[x_] = (x - 1)/(x - 1)? [closed]

In Mathematica 9 If I write: f[x_] = (x - 1)/(x - 1) I get 1 And if then I write: ...
1
vote
1answer
157 views

Random sample with gap sizes

Lets say I have 101 instances of data with multiple attributes. In particular case, one attribute has 7 unique values. I want to get ...
9
votes
2answers
299 views

Define Log so that negative reals evaluate on lower edge of branch

I need to get Mathematica to evaluate the logarithm of a negative real number using the lower branch instead of the upper branch, so that while ...
12
votes
3answers
504 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
3answers
200 views

How to rename a built-in function?

I want a built-in function renamed without loss of any properties, I want the shorter name to appear in all results and to be recognized as input. Is it possible?
2
votes
1answer
2k views

Filtering Lists in Mathematica [duplicate]

Possible Duplicate: Select/Delete with Sublist elements? I need help in filtering long lists of x,y coordinates.Lets use the following list as an ...
-2
votes
1answer
187 views

How to pass arguments between functions

I have two Functions, f[] and g[]. f is passed some values ,say ...
4
votes
6answers
207 views

Filter list with different list in it

I have a list like: {{{4, 14}, 1}, {{4, 15}, 1}, {{4, 16}, 1}, {{4, 17}, 1}, {{4, 18}, 1}, {{4, 14}, 3}, {4,15}, {{4, 16}, 2},{4,18}} Now I want to ...
10
votes
1answer
341 views

user defined functions, how to save them for future use?

I need certain user defined functions over and over. I was wondering how can I define and where and how to save them such that each time I start a notebook, these functions are available and need not ...
0
votes
1answer
1k views

Loops and subroutines [duplicate]

Possible Duplicate: Alternatives to procedural loops and iterating over lists in Mathematica I am new to Mathematica and not familiar with functional programming. In particular, I have no ...
0
votes
1answer
130 views

Solve 1-D function that has 2-D interpolating functions

I need some helps on NDSolve. Here are my equations: ...
4
votes
2answers
247 views

How can I use Max[] in a function that is passed a list not find the max of the list

For most functions in Mathematica, passing them a list will call the function on each element of the list. For example: ...
2
votes
1answer
142 views

Difference between function definitions [duplicate]

Possible Duplicate: Functions vs. patterns I thought about describing the context in which I faced this problem, but I figured it is general enough and clear enough to pose it as it is. ...
9
votes
1answer
235 views

Get the name of a symbol passed to a function

I'm trying to get the name of a symbol passed to a function with this: f[x_] := {SymbolName[x], x} SetAttributes[f, HoldFirst] x = 5; f[x] But ...
1
vote
1answer
123 views

Can I get a trace of the complexity of a convergent sum?

Motivation--- I have a glimmer of an idea that a convergent sum could be considered a self-referential number similar to a fractal. I would like to play with it for a while. I have the following ...
3
votes
1answer
130 views

Precise Timing for nested functions, how to? [duplicate]

Possible Duplicate: Profiling from Mathematica How can I easily get fractions of timing for each nested function? Consider a nested call like this: ...
0
votes
2answers
106 views

Saving variables from nested function

There has to be a simple solution for my question: I have three functions and each uses the output from the previous function as its input: ...
1
vote
1answer
90 views

Why function is evaluated backward?

I have a simple function: f[x0_,y0_]:= Module[{x=x0,y=y0},For[i=0,i<2,i++;Print[x],Print[x+y]];] So when I call it: ...
1
vote
1answer
165 views

How can I create some shorthand notation for a custom control?

Per this question, I have created a custom graphical control object which evaluates to a list of values. I would like to be able to create such an object quickly, rather than typing some command, ...
1
vote
1answer
221 views

Problem with function as an argument

I want to write a function like the following: s[u_, v_, x_, val_] := u[val]/NIntegrate[u'[x] v[x] + u'[x] v'[x], {x, 0, 1}] So I can evaluate something like ...
3
votes
2answers
260 views

Numerically finding a derivative jump of a function

How would I numerically find where a function has derivative jumps? In particular, I'm working with this function: ...
0
votes
1answer
339 views

How to create function that classifies sample data

I want to create expression, that classifies samples ( 4 weather features -> decision). Example training data: For the values that i have data for, I can use rules: ...
3
votes
1answer
275 views

Plot maximum and minimum temperature of a day for range of time interval

How to display (in any graphic representation) the maximum and minimum temperatures for one city in one of these selected time periods over the 5-day period? The time periods are: Morning (06:00 to ...
2
votes
1answer
741 views

How to define the Einstein summation convention in Mathematica?

How to define a Einstein summation convention in Mathematica? Say, how to let Mathematica know T[i,i] equals ...
6
votes
1answer
493 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 ...
2
votes
1answer
145 views

#[[1]]//FullForm = 1?

I have a set of symbolic algebraic expressions that I'm trying to get some speed into. To illustrate the issue, I'll use a simple form like { k0 X, k1 Y, k1 Z}, ...
2
votes
1answer
324 views

Cournot Equilibrium

I'm trying to determine reaction functions of a Cournot equilibrium for $n$ firms using the same optimal condition, using the fixed point method. This is the method I'm using: ...
0
votes
1answer
242 views

How do I numerically solve a custom function?

Whenever I use functions like FindRoot or NDSolve, it sends x through the function and deals ...
6
votes
1answer
249 views

GeneralMiniMaxApproximation - Dividing out the zero

MiniMaxApproximation is used to generate minimax approximations. I'm interested in the "dividing out the zero" trick. The documentation discusses a nice example. Suppose we want to construct a ...
1
vote
2answers
760 views

Interpolating a function of two variables

I am trying to create the interpolating function for a function of two variables, over a finite area. Just for consistency we can think of a function: ...
10
votes
2answers
907 views
4
votes
3answers
2k views

Passing a function as an argument of another function [duplicate]

Possible Duplicate: Pass function or formula as function parameter I am trying to implement a simple Plot[]-like function, with the same synopsis; my first (and unique so far) try would be ...
10
votes
1answer
664 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?
7
votes
0answers
179 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 ...
4
votes
3answers
370 views
6
votes
2answers
297 views

A command for outputting a list of parameter values in a Manipulate interface

I am looking for a command that will output a list of values that correspond to the current parameter values manually set on a particular Manipulate interface. For ...
4
votes
2answers
580 views

How to make a function that evaluates an expression?

I'm trying to make a function where the input is an expression, but somehow it just won't be evaluated. For example, this little function doesn't work: ...
2
votes
1answer
384 views

Plugging values into functions

I am very new to Mathematica, and need to know how to plug values into existing functions. For example, Math World supplies the following code for building a truth table of ...
2
votes
1answer
265 views

Creating a matrix from the output of a variable inside a for loop

I would like to enter the results of the following loop inside a matrix as its elements: ...
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 ...
2
votes
1answer
271 views

About high dimensional integrals

I want to be able to do high dimensional integrals like, (..naively I wrote it as this..) ...
1
vote
2answers
146 views

How to mix Unevaluated property of function arguments with expression assignments?

This is a follow-up to my (solved) question How to distribute a generic function of two arguments (without evaluating the arguments) Say, I have a binary function ...
9
votes
3answers
372 views

Why does Hash return different values in Version 7?

This function does not work correctly for me. The generated Gravatars do not match the ones actually produced by using the corresponding address. The problem was traced to differing output from the ...
3
votes
2answers
2k views

Plot Even Piecewise function

Is it possible in Mathematica to plot an even piecewise function like: $ f(x) = \begin{cases} 3t , 0 \le t \le \frac{\pi}{2} \\ 3t + 6 , \frac{\pi}{2} \le t \le \pi \end{cases}$ which has ...
4
votes
3answers
175 views

How to distribute a generic function of two arguments (without evaluating the arguments)

I guess there is an easy way to do this, but I can't seem to figure it out. What I would like to do is to distribute a generic (i.e. without specifying what this function really does) binary function. ...
1
vote
2answers
84 views

Using non-Graphics primitives when exporting to .cdf

I'm trying to embed a "Manipulate" applet I've created into a webpage by embedding a .cdf. I'm running into a problem with displaying outputs from functions I've written. Here is a simpler example ...
7
votes
1answer
446 views

Demonstrating Ackermann's Function

The Ackermann function is an extremely fast growing function. There are some slightly different versions of the function, but the one that I am looking for can be defined as: $$ A_0(x)=x+1 \\ ...
3
votes
3answers
195 views

How to set a function as a parameter?

In case I want to know whether a given function $f(t)$ have some property, I tried to write something like this: ...