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

learn more… | top users | synonyms

1
vote
1answer
38 views

How to call a function with an arbitrary list as its arguments inside a functional? [duplicate]

I have the following functional defined (i.e. a function of another function) where variableList contains the variable (arguments if you wish) of the ...
4
votes
0answers
92 views

Argument attributes for pure functions [duplicate]

In his book, Leonid Shifrin says: One important limitation of the # - & notation for the pure functions is that it is ...
0
votes
1answer
39 views

Replace argument of delayed function before it evaluates [duplicate]

How should I use replace so that f[x_] := x^2 Replace[f[3], 3 -> 1] OUT = 9 evaluates to 1, instead of 9? This way, the replacement of the argument is done ...
1
vote
0answers
39 views

finding list by expresion [closed]

Well Im new to mathematica. I have list of x which contain {1,23,45,6,43}. And I get expression from g = Fit[t, {1, v, v^2}, v] how can apply list x to g to ...
4
votes
1answer
123 views

What is wrong with my code so it neither produces a correct plot nor an error message?

I am trying to define some initial functions and then using them to define my secondary functions and then plot the secondary functions. I am supposed to get two curves with a finite width ...
3
votes
2answers
130 views
2
votes
1answer
72 views

How to plot a function whose constant parameters have associated uncertainties in Mathematica 8.0?

Let's assume I want to plot the function $f(x)=a + bx+ cx^{2}$, where experimentally known values of parameters $a, b$ and, $c$ are as follows: $a=1.01 \pm 0.18$ $b=0.92 \pm 0.11$ $c=2.2 \pm 0.2$ ...
3
votes
3answers
210 views

How to get exact coordinate of a point from a plot?

I am using BodePlot[] to plot the magnitude and phase of a function as below. BodePlot[1000/((1 + s/10^3)*(1 + s/10^6))] ...
0
votes
1answer
85 views

Intercept in the ARProcess

In the ARProcess help file I don't understand whether an intercept is included or not. How would I add one? I am using version 9 of Mathematica.
1
vote
2answers
49 views

FourierSeries command , for arbitrary period T?

ExptoTrig[FourierSeries[Piecewise[{{-Pi,-2Pi<x<=0},{Pi,0<x<=2Pi}}],x,3]] You can see, the function goes from $(-2\pi,2\pi]$ But Wolfram Alpha gives a ...
2
votes
1answer
67 views

Can I create a mouseover summary or documentation for a new function?

In Mathematica, when you hover any a built-in function, a small window with 2 symbols appears (as in the third paragraph of this reference page, see picture): clicking on the former one gives you a ...
4
votes
1answer
91 views

Trying to create an interactive plot (newbie here)

I'm new at Mathematica so please bear with me. I am trying to create an interactive plot that will end up looking like this: I want to input values for certain variables and then plot a curve. This ...
1
vote
1answer
63 views

Defining functions as derivatives

I'm working on a model that requires a sum over a function that uses various coefficients. In order to make the sum easier to perform, I am trying to keep things general through the use of a ...
4
votes
1answer
155 views

Defining a matrix with elements acting as operators

This question is directly related with my previous one. I'll try to be more specific here. I have a matrix {{a[x],b},{c,d}}, where ...
-5
votes
1answer
58 views

What is this function aimed to do? [closed]

Table[Sum[tmatrix[[i, j]], {i, 1, 2}], {j, 1, 2}] apparently creates some sort of a table, and it evidently works on a matrix....although it is hard for me to understand what should it do beyond ...
-1
votes
1answer
78 views

Scan over regions of parameters

I have a function f which takes three arguments x, y and z: f[x_,y_,z_] := 2 x + 0.5 y + z ...
1
vote
0answers
43 views

Is there any point to using a variable as a function parameter?

Normally one only sees patterns as function parameters: fun1[x_]:=x^2 Is there any point to using a variable in a function definition: ...
1
vote
2answers
125 views

Function does not execute commands and fails to evaluate [closed]

The code I am trying to execute: hh[x_, y_] := x + y; hh[{3, 4}] The expected output: 7 However, on output I get ...
3
votes
2answers
135 views

UI characteristic function [closed]

I have three given points: $\qquad $A$\qquad $(0; 5.9) $\qquad $B$\qquad $(18; 5.56) $\qquad $C$\qquad $(22.32; 0) I don't know how I can create a function like the one in the image below with ...
0
votes
1answer
52 views

How to create a function that can be evaluated for specific values [closed]

I have been trying to create a function to compute a field and perform operations with it, however when I try to define it I have used: ...
7
votes
1answer
115 views

Generalizing LongestCommonSequence to 3 or more arguments?

The function LongestCommonSequence finds a longest common subsequence between 2 lists. Apparently, this built-in function does not accept more than 2 arguments. How ...
0
votes
1answer
42 views

Selecting terms on only one variable from a multiple-variable expression

Say I have a polynomial like $x y^2+15x^2 y+x+3y+10$ and I want to obtain, say, only the coefficient in $x$ alone, namely a 1. Using ...
2
votes
1answer
44 views

Help Compiling Vectors using Iterations

So I have a nice code that runs properly, which I include below but, in my naiveté, I'm having issues iterating my procedure. Simply put, I have a function of two real variables $f(x,y)$ and I want ...
1
vote
1answer
50 views

Extra restrictions in best response functions using Manipulate[ ]?

I have two best response functions that I have defined like this: ...
0
votes
1answer
36 views

Parameterize Subset of Complicated Zero Set

I recently asked this question: Evaluating Functions on Zero Sets (of other functions), and got fantastic assistance, but realized that there seems to be an extra issue when you're trying to ...
3
votes
2answers
109 views

Evaluating Functions on Zero Sets (of other functions)

I have a highly non-trivial function, call it $f(x,y)$, in which I want to look at its zero set in the $(x,y)$ plane, and plot/evaluate a different function $g$ precisely along this zero set. I have ...
3
votes
2answers
133 views

Replacing multiplication of matrix elements by application of these elements as functions

I want to realize the following idea in Mathematica. I've got a matrix {{a,b},{c,d}} which is multiplied to a vector {h,k} ...
0
votes
0answers
34 views

ApartSquareFree function

I have a doubt concerning the ApartSquareFree function in Mathematica. Roughly speaking, it is supposed to compute the partial fraction decomposition of a rational function $h/g$ with the denominators ...
1
vote
0answers
35 views

Which the functions of parameters can use Span [closed]

As I know,ImageValue,PixelValue,ReplaceImageValue,...
8
votes
1answer
111 views

What is ExpectationE and what does it do?

I just found the symbol ExpectationE with autocomplete. Rendered the symbol is Searching the documentation and the internet leads to nothing. Does somebody ...
3
votes
1answer
70 views

Extended AutoCorrelation Function

Is there a function in Mathematica capable of computing the sample Extended AutoCorrelation Function (EACF)? I know that there's a package in R that does this. I was trying to avoid to having to ...
2
votes
1answer
71 views

ListPlot of auto-correlation function pushes data 1 lag

I'm trying to plot a graph of a sample autocorrelation function at different lags. The code I'm using is ...
1
vote
0answers
39 views

Getting a list of function definition parameter values [closed]

If I define a function over certain values: f[0] = 1 f[1] = 2 f[2] = 3 How do I get the list of parameter values that it's been defined on? ...
-1
votes
1answer
66 views

Plotting a function of another function

Edit: So I have several functions which come from other functions. For example: ...
1
vote
2answers
68 views

Selecting points in list that are inside a contour [duplicate]

I have a list of points which form a closed (connected) contour or path in two dimensions. I would like to get all points from a second list which satisfy the requirement that they are inside the ...
-1
votes
1answer
86 views

How can i 2d-plot Cobb-Douglas function?

can I plot Cobb-Douglas function in 2D without using ContourPlot? I have this function: u[x1_, x2_] := Log[x1] + 2*Log[x2]; and now I plot it using: ...
1
vote
4answers
142 views

Implicitly inverting a function from numerical solution [closed]

I have the following piecewise continuous function: ...
11
votes
1answer
128 views

Definition of Mod and Quotient with complex arguments

How are Mod and Quotient defined for three real/complex arguments? I wasn't able to find the definition. My main surprise so ...
1
vote
0answers
54 views

How to avoid tranfer the array as a parameter [closed]

I have following array: data = {x^2, 2*x^2, x^3}; And I must send it to the following function: ...
3
votes
1answer
77 views

Pareto optimal fronts using internal function?

Reading this question: How do I estimate the Pareto front in my multiobjective optimization problem? I found @Daniel Lichtbau's interesting answer. Yet I don't know how such an "internal function" ...
1
vote
1answer
111 views

Evaluate pure function through round brackets

In have some matrices of pure functions or numbers which I multiply by other matrices or vectors. I would like the functions to be evaluated in the result, but all that I get is something like this: <...
0
votes
0answers
29 views

PolynomialExtendedGCD in 2 variables

Consider a field $R$ and the ring $A=R[y]$. Consider two polynomials $g,h\in A[x]$. I want to obtain $d=\gcd(g,h)\in A[x]$ and two polynomials $s,t\in A[x]$ satisfying the Bézout relation: $sg+th=d$. ...
15
votes
1answer
135 views

Is it better to completely forget about the existence of PowersRepresentations?

I noticed that in several cases the performance of PowersRepresentations is hugely worse than that of IntegerPartitions. (Mma 10....
5
votes
0answers
139 views

Is there an internal logic behind short form symbols, such as @ (Prefix), @@ (Apply), /@ (Map), /. (ReplaceAll) [closed]

To me, function names (such as Apply and Map) seem more intuitive than their symbols (e.g. @@...
2
votes
2answers
58 views

Substituting within a function definition that includes Simplify

I would like to define a function like myfunc[f_] := Simplify[(f/g)] where g will be substituted/replaced with the current value of g at the time of definition. ...
3
votes
1answer
68 views

Checking if input is a function

I would like to write a program to find the leading coefficient of a given polynomial. (Sounds easy, right?) I'd like to be able to handle the format x^2-x+7 (with ...
3
votes
3answers
182 views

Return a sentence with numerical values

I have the following function: example[a_, b_] := Module[{c}, c = a + b; Return["The solution is c"] ] I would like to know how to return that ...
6
votes
3answers
149 views

What function superseded SpaceForm?

In older versions of Mathematica you could use SpaceForm to leave a certain amount of spaces when writing to a file. For example, if we have the following data: <...
10
votes
1answer
176 views

Core functions or operations that every aspiring Mathematica programmer should know? [duplicate]

I am aware that there are common yet very powerful operations like Map, Thread, Apply, ...
6
votes
2answers
323 views

What does empty {} mean in Module? [duplicate]

I have a question. I would like to know what an empty list ({}) means when used in Module[] as the code below shows? Why has a ...