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

learn more… | top users | synonyms

2
votes
1answer
75 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 ...
0
votes
3answers
83 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 ...
0
votes
1answer
45 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 ...
0
votes
0answers
52 views

Getting error Clip::ncompl from my trigonometric expression

In my Mathematica code has used Clip in NDSolve, but I'm getting with this error: Clip::ncompl: Symbolic or noncomplex ...
0
votes
2answers
170 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 ...
4
votes
0answers
79 views

Why does FromDigits transpose its argument (sometimes)?

FromDigits /@ Transpose@{{1, 2}, {3, 4}, {5, 6}} == FromDigits @ {{1, 2}, {3, 4}, {5, 6}} (* True *) The only "strange" syntax I've found in the docs is ...
1
vote
0answers
58 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 ...
2
votes
2answers
138 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 ...
1
vote
0answers
93 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 ...
7
votes
1answer
134 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 ...
1
vote
2answers
183 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. ...
4
votes
3answers
171 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. ...
7
votes
1answer
141 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., ...
4
votes
0answers
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) : ...
14
votes
1answer
407 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 ...
1
vote
1answer
138 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 ...
2
votes
1answer
62 views

RootReduce-Part of Solve

I have given the following expression in $M$ and $z$: \begin{equation} 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 ...
9
votes
2answers
234 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: ...
12
votes
4answers
208 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 ...
3
votes
1answer
67 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: ...
3
votes
2answers
96 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 ...
0
votes
1answer
70 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: ...
20
votes
1answer
209 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: ...
3
votes
0answers
61 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 ...
2
votes
1answer
85 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 ...
1
vote
0answers
75 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 ...
2
votes
2answers
74 views

Replace All using a list

I have a more complicated case however a basic example is; ...
4
votes
2answers
233 views

Generate the Fibonacci sequence with Accumulate

Is there a way to generate the Fibonacci sequence with the Accumulate function?
0
votes
1answer
120 views
-2
votes
1answer
78 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 ...
3
votes
1answer
125 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 ...
2
votes
1answer
181 views

Fitting one set of data with two function

I have a set of data (42 points): ...
8
votes
3answers
206 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 ...
0
votes
2answers
110 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 ...
0
votes
1answer
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
1
vote
1answer
56 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 ...
2
votes
1answer
134 views

An error disappears?

I needed to define a table of functions. And I did it like this: ...
11
votes
1answer
119 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 ...
-1
votes
4answers
104 views

Converting an expression to function [duplicate]

I have the following problem. I current can automatically create the variable positionPayload, for instance: ...
3
votes
3answers
198 views
1
vote
1answer
72 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. ...
0
votes
1answer
59 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, ...
0
votes
1answer
64 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 ...
6
votes
2answers
69 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 : ...
4
votes
1answer
106 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: ...
2
votes
2answers
88 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: ...
0
votes
2answers
58 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: ...
0
votes
1answer
69 views

Implementing Antilogarithm[b, x] and Cologarithm[b, x]

Mathematica functions for antilogarithm[b, x] and cologarithm[b, x] don't appear to exist, but I think they could be ...
11
votes
0answers
118 views

HistogramList is much Slower in 10.2 vs 10.1

While I was running a code I wrote using version 10.1, I noticed that in version 10.2 the running time of the same code was more than twice as long. After some digging, I figured out the culprit is ...