# Questions tagged [functions]

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

2,814 questions
Filter by
Sorted by
Tagged with
0answers
62 views

### Fold Dynamic Function [duplicate]

I'm making on a demo working with differential equations as functions of two variables (x and y). The demo will have to Fold the differential equation with an initial y-value and a series of x-values. ...
0answers
41 views

### Problem with slot in If statement [duplicate]

I am struggling with slots, In this case I have a function int which gives either true or false. When it gives true, I want ...
0answers
23 views

### Question about a ParametricPlot with a shading grey family of lines and/or different sizes [duplicate]

So, I have this function of the polar angle $\theta$, with a varying parameter $t$: {Cos[\[Theta]] (1 + Sin[t]), Sin[\[Theta]]} and I want to draw it in a ...
0answers
342 views

### Using Table[ ] vs using Do[Append [ ] ] [duplicate]

Is it generally better/faster to use the Table function over using Do[Append []]? For example, I have this piece of code: <...
1answer
1k views

### Pass unevaluated function with evaluated arguments

I am almost sure that this question has been asked somewhere. I found similar ones, but I cannot find exactly what I need, which might mean that I am on the wrong track. I search a method to pass an ...
0answers
56 views

### Generating Suffixes [duplicate]

I am doing a large Matrix calculation in which I need to generate symbols first like $F^{\mu\nu}$ I would like to get $\mu\nu = 00, 11, 22, 33$ and so on. I need to have the symbols before I can ...
1answer
200 views

### Loop function question [duplicate]

I'm new to Mathematica. Below is the code I have trouble with. ...
0answers
112 views

### Display functions without dependence?

I'm solving systems of equations with a few different functions of time, t, and so I'm getting output with lots of [t] running around. Is there a way to display these functions without the dependences,...
0answers
27 views

### Incorporating Built-In Function Options/Parameters into Shorthand [duplicate]

Shorthand syntax provides an alternate way to apply functions and, in many cases, improves readability. A simple example would be ...
0answers
80 views

### Limits of PrimeNu [duplicate]

Is there any way to find distinct prime factors for very large numbers using Prime and/or PrimePi that exceeds the capabilities/...
0answers
66 views

### mathematica function autocomplete issue [duplicate]

This is the default function structure prompt from Mathematica 9 This is my own function module ...
0answers
121 views

### creating some smooth density functions

I would like to create some density functions based on some distance measure $D$. As a base density function lets say I have a Gaussian density $f$ with mean $-1$ and variance $1$. I would like to ...
1answer
126 views

### Stop function evaluating input at time of definition [duplicate]

I would like to create a function that acts on whether the input is even or odd, e.g.: In[644]:= f[a_] = If[EvenQ[a], 2 a, 3 a]; f[2] Out[645]= 6 I've ...
0answers
75 views

### Defining functions in a loop [duplicate]

I have a symbolic solution to a linear system with respect to some variables a[i,j] which depend on a parameter t. sol=Solve[...,Table[a[i,j],{i,0,n},{j,0,n}]] I ...
1answer
687 views

### How to define a pure function with a Module?

I was not able to use a self defined (using Module and For loops) piecewise function to fit data. It seems that the problem is that I have to define a pure function. I would like to learn how to ...
0answers
222 views

### How Can I Use Conditional with Rational Domain Restrictions [duplicate]

I am reasking this question in a new thread. My previous post How Can I Use Solve/Reduce Output? seemed to have led to a an interesting dissussion of how to (better) solve the problem that produced ...
4answers
230 views

### Converting an expression to function [duplicate]

I have the following problem. I current can automatically create the variable positionPayload, for instance: ...
4answers
2k views

### Compare elements in a list

Assume that there are three different points in x-y coordinate like: p1={4, -1}; p2={5, -2}; p3={1, 5}; In order to compare these points to each other in a ...
2answers
5k views

### Plotting self-made functions [closed]

EDITED AS SUGGESTED I have defined a function, which takes two values and returns a function n(x), like so ...
1answer
984 views

### Find minimum function value in data and give coordinates of minimum

I create with Table an array containing the function value of some function and the n1and n2...
2answers
318 views

### How can I extract when a select condition is met in a do loop the value of the iterator?

I use the following code to find out the number of consecutive prime numbers using a formula $n^2+n+i$ found out by Euler (starting from n=0): ...
2answers
2k views

### How do I generate a table of data points from a function and add random noise? [duplicate]

I am trying to generate a table of data for the function: ...
3answers
157 views

### Creating Do loop that cycles back to earlier values

I need to create a Do loop that distributes letters in a list of lists. I also need to be able to cycle back through to the beginning of the list. For example, I ...
1answer
63 views

### Expected value of Product of N terms from a Distribution

I don't understand how to calculate The Expected value of ā x(i) for N values of x(i) taken from a uniform distribution. i.e. to generalise ...
1answer
224 views

### Problems in plot of $e^x$ [closed]

I try to plot the function e^x in Mathematica and I enter the following command: Plot[e^x,{x,-1,3}] but the only thing which appears is a plane with a scale on the ...
2answers
1k views

### The prime numbers between 1 and 100 [closed]

I'm new on this and the help seems not as helpful on this particular subject The prime numbers between 1 and 100 mathematica show steps
1answer
56 views

### What is the problem in this program? [closed]

The output is showing running only. For[m = 0, m < 0.05, m++, For[a = 5, a < 20, a + 1, a1 = a*(a/2); x[m] = a1 ]; ];
1answer
157 views

### Plotting a continuous function in discontinuously

I have a function called $s$ which is a very complicated function of two variables x and y. I want to plot a 2d graph with axes representing x and y parameters and colored points show sign of function ...
1answer
1k 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: ...
1answer
67 views

### List command separating multiplicative terms [closed]

I am trying to separate and store additive terms via the List command. For instance I want "AB+CD+XY" to be stored as {AB, CD, XY} This has worked well, but when there is only one term (only ...
2answers
52 views

### If statement inside a for loop to find a function?

I am trying to find the value of two functions with two variables by using for loop. Then I want them to satisfy a condition and if that holds then I want to write only those sets of the variables for ...
1answer
66 views

### plot the two functions in one picture for a/l=0.1 and give the code [closed]

two functions i need to plot in one picture the required answer for a/l =0.1
1answer
57 views

### Getting specific values from Solve to plug into function [closed]

I have four functions of four variables, f1,f2,f3,f4 and x,y,z,theta. I solve these using ...
1answer
107 views

### Error for Returning the multiple output of a function, error code: Return::nofunc [closed]

I have the following piece of code, and when I call it with "BulirschStoer[Range[0, 1, 10], 0, 10^-2]" in Mathematica 11 I receive the error message as shown in the picture. I was wondering if anyone ...
1answer
337 views

### Evaluate complex exponential expression [closed]

I am trying to evaluate the modulus of the following expression. The expected result is 1.3. However, I tried Abs, ComplexExpand but still couldn't get it. Can anyone help me out? Thanks. 1/(1+e^(...
1answer
478 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 ...
1answer
104 views

### Plotting a function of another function

Edit: So I have several functions which come from other functions. For example: ...
1answer
84 views

...
1answer
220 views

### need help to price a european option using finite difference method [closed]

I am writing a function to price European option using backward induction finite difference method. The function is expected to price a European option taking Stock (stock_), age (time_), volatility (...
1answer
128 views

### Transformation of a simple logic statement

I'm designing a logic circuit and I was wondering if the following two things are equivalent: (x <= y) and (x < (y + 1)) I can't think of any set of numbers that would make these two things ...
1answer
725 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. ...
1answer
187 views

### Native function in Mathematica export functions from Mathematica to MATLAB

Is there any native function in Mathematica (not ToMatlab) that I can export a function from Mathematica to MATLAB, to Paraview or to any plotting software? Clarification: I want to export something ...
1answer
748 views

### Mathematica does not plot my expression

Mathematica does not plot the expression. ...
1answer
96 views

### My code of plotting a two-variable function is too slow [closed]

I have a code in which my complicated function to be plotted is F(x,p). I would like to graph it for 5 values of p equal to 10^7, 10^8, 10^9, 10^10 and 10^11 for x values between 0.01 and 0.99. All ...
1answer
149 views

### What is wrong with my code? [closed]

What is wrong with my code below ...
1answer
236 views

### Why is my function returning 0 when when I try to give it arguments by replacement? [closed]

I tried running a function f with rules and calling it directly with arguments specified directly but the one with rules returns zero while the one with direct ...
3answers
102 views

### Two unrelated questions: 1. Output of Series[] for function, 2. Output conditional answers as if not conditional [closed]

As mentioned in the title, I have two questions. 1. I have code that looks similar to: ...
1answer
2k views

### plot sum of two function [closed]

I am trying to illustrate sum of functions. I have one function x*x - 8*x + 7 and another Log[2*x + 4.5] I understand that I ...
1answer
173 views

### Plotting 3-dimensional graphs [duplicate]

I just started Calculus 3 and I thought it would be useful to see images of functions to get used to the transition of visualizing in 3-dimensions. I was wondering how one would go about plotting a ...
3answers
107 views

### How to change function iteratively as a function of its previous form?

I am trying to do the following :- f[x_] := {x, 2}; Do[f[x_] :=Append[f[x], {x, 4}],{3}] % runs into recursion limit because I want to grow my function (which ...

1
ā¦
53 54 55
56
57