# Tagged Questions

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

250 views

### How do Reap and Sow work in this context

I have a list of points in 3D and I need to count how many times each point is repeated. For a similar problem with a list of characters many different solutions have been proposed in this post: ...
79 views

### Issue plotting/re-creating 3d function

I am trying to re-create images created in Mathematica using the equations in the photos attached. I was able to somewhat plot the Equation 6 (Cartesian coordinates) Figure 4 using this code <...
118 views

### How to Change Vertex List in a Grid Graph

I would like to actually change the vertices in a grid graph instead of simply changing the label. Ultimately, I want the vertices to be points on a plane. So if given a simple grid graph ...
48 views

### Problem with Apply [duplicate]

I have am trying to obtain the average of the distance from the mean radius for each shot in a group of shots at a target. I am having problems with the very last line. The output of the last line ...
186 views

### Approximate UnitStep for use in Enterprise CDF

The following Manipulate code displays the VectorPlot for all functions. (This code is a subset of a more extensive notebook which is based on the structure you see below. Consequently, I need to ...
93 views

### Why does FromDigits transpose its argument (sometimes)?

a = {{1, 2}, {3, 4}, {5, 6}} ; FromDigits /@ Transpose@ a == FromDigits @ a (* True *) The only "strange" syntax I've found in the docs is But it doesn't ...
59 views

### Why can't I use OmegaPrime to find the Limit of Prime[n]? [duplicate]

I've looked at these links already; What are the limits of the Prime-functions? What is so special about Prime? which gave an answer for earlier versions of Mathematica. Yet when I try to input ...
153 views

### How to correctly scale the x axis?

I am not absolutely sure how to formulate my question but here is my first attempt: I have 25 rods with lengths in cm ...
94 views

### what is the means of (0 -> 1) of series expansion [closed]

I use mathematica 8 to take a taylor expansion.In the Output, the expression (0->1) appears in the second term and all higher order term, and this expression is multiplied with other coefficient and ...
143 views

### How would one return from a place of a pure function's body using Return?

From previous answers, replies and discussions it is known, while not formally documented (even in the most recent Wolfram Language Documentation Center), that Return can be used in a two-argument ...
212 views

### Restrict domain of a function?

I have a function f[x,y,...,z] and I want to restrict its range to positive numbers only, f > 0. ...
185 views

### Convert FullForm to XML Structure and back

How might I create a function that converts between FullForm and a XML structuce? Ultimately I'm ideally looking to use CSS and JS to edited the XML structure. ...
145 views

### What kind of creature is h[c] for definition h[c_][x_] := (* function of x and c *)

To implement "Hero's Method" for approximating $\sqrt{c}$, one iterates the function (x + c/x)/2 for a given number c (e.g., <...
92 views

### Optimization of recursive functions by using the //. operator [duplicate]

In some cases, recursion in Mathematica (without storing values) is not very efficient. For example, the recursive implementation of Fibonacci numbers (version which doesn't store the values) : <...
431 views

### Why is an Identity function needed?

Today I came across the function Identity[x] in Mathematica (documentation). The example given in the documentation uses it in ...
196 views

### How to create a vertical (smooth) Histogram on the y-axis of a function graph for an uncertain x?

This is my first time posting a question in StackExchange. I have encountered a certain problem and I can't seem too find a solution. Just a word of caution, I am kind of an amateur when it comes to ...
64 views

### RootReduce-Part of Solve

I have given the following expression in $M$ and $z$: a = \frac{-4 M^2+M (-3 z-5)+\frac{1.1875 z}{\sqrt{\frac{0.015625 z}{M+1}-1.5625} \sqrt{\frac{0.765625 z}{M+1}-0.5625}}-1}{M+0....
239 views

### Pattern and Orderless function

I'm a Mathematica beginner. I am exploring the use of patterns and (only for fun) am trying to implement a permutations function. My (dirty) code is: ...
268 views

### Distributing function arguments with function compositions. How to compute $(f + g^2)(x) = f(x) + g(x)^2$?

Suppose I have two functions f and g. To compute $f + g$ evaluated at a point $x$, I know that one can use ...
77 views

### Table generation with SetDelayed function [closed]

I would like to understand why the following two outputs differ: Let us define the following data set: ...
105 views

### Working with CDF Deployment

I've been working with FreeCDFs in Mathematica 10 and it has been going fine as long as I do not pull from a database or access local files. I recently purchased the Mathematica 10.2 Enterprise ...
79 views

### Working with functionals [closed]

I am trying to work with functionals in Mathematica, this means that I want to define a function of a function. I defined my function of a function as: ...
222 views

### Strange behavior with Cases and Position with SetDelayed

I feel like I must be missing something simple and obvious here, but this has me scratching my head. This works as expected: ...
63 views

### Why is the evaluation of f different using rules and using arguments to it as a function? [closed]

I will provide all the code I used at the end of the question. I was trying to evaluate a function f with the following signature (which I'll give the details at ...
86 views

### creating a stacked function that returns the multi varibles

I'm a beginner in Mathematica with little programming background but I'm determined to learn this. I'm trying to make a function that calculates two variables r2 &...
66 views

...
126 views

### Input List of Images into a cloud deployed API function

I'm new to APIFunction and CloudDeploy, but essentially, here's my situation: I have a function (let's call it ...
77 views

### Replace All using a list

I have a more complicated case however a basic example is; ...
248 views

### Generate the Fibonacci sequence with Accumulate

Is there a way to generate the Fibonacci sequence with the Accumulate function?
237 views

...
86 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 ...
220 views

### Derivative of conjugate multivariate function

I have a problem with Mathematica, taking the derivative of the conjugate of some function. I know that a similar question has been posed before here, but the solution did not work for multivariate ...
208 views

### Fitting one set of data with two function

I have a set of data (42 points): ...
218 views

### Adding colors to graphic objects made with the new function AnglePath

The MMA 10.2 help gives many examples of AnglePath lines of code but all of them are of the same color and I am quite at a loss to devise a method to add colors ...
125 views

### How does one define a function that takes vectors as arguments but also derivatives?

Summary: tldr; I just want to implement a version of the following mathematics function: $$f(a) = c_1 e^{-(a - t_1)^2} + c_2 e^{-(a - t_2)^2} + c_3 e^{-(a - t_3)^2}$$ in mathematica, and be able ...
35 views

### How can I apply a matrix 2*2 to binary digits? [closed]

I want to apply a matrix 2*2 to a binary digits. For example, D and E are two matrices that they apply to a 1 and 0. D --> 1 & E --> 0 binary digits: (1011) --> D.E.D.D
59 views

### Using Get function to return a specific expression

I am trying to use Getto import data saved as a .nb document. The problem is Getevaluates all expressions but only returns the ...
135 views

### An error disappears?

I needed to define a table of functions. And I did it like this: ...
127 views

### Using Rules inside SequenceCases degrades Performance

Consider the following: SequenceCases[Range[10^4], {a_?PrimeQ, b_, c_?PrimeQ}]; // AbsoluteTiming {0.0058148, Null} If we now try to use a rule to transform ...
107 views

### Converting an expression to function [duplicate]

I have the following problem. I current can automatically create the variable positionPayload, for instance: ...
198 views

I have ...
75 views

### I keep writing functions like this one: subtract[{a_, b_}] := Subtract[a, b] [duplicate]

(Edited to provide an example) Recently I have found myself writing silly functions like the following, which is just a new arity of Subtract in which the arguments are inside a list. ...
61 views

### Reverse of Apply on built-in functions [closed]

So if I have can use Apply and Or in combination: Or @@ {a, b, c, d} Out: a || b || c || d One could also use Or[a, b, c, ...
85 views

### Create a sum with the Do function and modules

I should define a function which sums up from k=0 to 100, with x=1; using the ...
75 views

### How to count the number of values in a discrete function?

I have a discrete function of an integer variable $n$ defined like this : ...
122 views

### Substitute a function's definition for its name

I'm having trouble with a function which is supposed to work on another function. Simplified version: ...
93 views

### Options for a function I define that can be passed to functions I call in the definition

I know, this is very close to Functions with Options and/or Function with custom Options and modified Options for built-in Symbols, but I don't get it. My function looks like this one: ...
62 views

### Function to list Collatz sequence doesn`t work [duplicate]

I am new to Mathematica and was trying to make a function that lists the Collatz sequence stating with a given number, but I can´t get it to work. Here is my function: ...