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

learn more… | top users | synonyms

0
votes
0answers
41 views

Can I make an array which varies with respect to 3 variables? [on hold]

Is there a way to have a function change based on different conditions? For example, let's say I have a function f[x_,y_,z_]:=f[z], where ...
10
votes
1answer
852 views

Why is this 2D plot so slow?

I first do a 3D Plot of four surfaces (eigenvalues of a $4\times4$ matrix) over $kx,kz$ (setting $ky=0$ all along). And then I try to give a 2D plot along three connected particular lines in ...
106
votes
12answers
5k views

What are some useful, undocumented Mathematica functions?

There have already been some questions about some undocumented functionality in Mathematica. Such as (please add to these lists!) How can one find undocumented options or option values in ...
3
votes
1answer
62 views

Do Any of the filter functions perform a LOESS or LOWESS filter?

From the Data Transforms and Smoothing guide there is a link to the Linear and Nonlinear Filters guide. Do any of these filter functions perform a LOESS or LOWESS filter on set of paired data? ...
-4
votes
0answers
42 views

About functions of a matrix [on hold]

I have a matrix problem. My question is: $f(x) = 3x + 1$, find $f(A)$, where $A = \left(\begin{array}{} 1 & 3\\ 2 & 0\\ \end{array}\right)$.
9
votes
4answers
1k views

How to completely delete the head of a function expression

Is there any way to completely remove the head of an expression function? For example, how would I remove the head Cos from ...
7
votes
2answers
286 views

Why doesn't this pattern work?

I want the in-built function Count to count the elements in a list which are greater than a value. Example: ...
15
votes
1answer
266 views

What has changed in the Template system in 10.3?

Bug introduced in 10.3 and persists through 10.3.1. There are couple of issues that are breaking my code after upgrading to 10.3. I wasn't able to narrow all of them down but this is what I've ...
1
vote
1answer
78 views

Double arguments and place of the underscore

Could someone explain me of this bit of code below is correct: Is it possible to define a function with a second bracket, see below, i.e. f[x_][y_]? And what does ...
1
vote
1answer
45 views
18
votes
5answers
450 views

Partitioning a list when the cumulative sum exceeds 1

I have a long list of say 1 million Uniform(0,1) random numbers, such as: dat = {0.71, 0.685, 0.16, 0.82, 0.73, 0.44, 0.89, 0.02, 0.47, 0.65} I want to ...
5
votes
0answers
112 views

Unexpected behavior from Indexed

I was going to include Indexed in this answer, thinking that it operated much as a List-only ...
1
vote
1answer
55 views

How do I write a function inside a ArgMin

I want to solve this ArgMin[NIntegrate[(Tanh[x] - Erf[x/a])^2, {x, -5, 5}], a] and it does not work, what is the correct way to do this? ...
-2
votes
0answers
70 views

I need to write an animation of something l [closed]

I need to write an animation of something like this: [![enter image description here][1]][1]
1
vote
2answers
43 views

using Map to apply 2 lists to the LCM function - help [duplicate]

I have 2 lists of numbers and I want to quickly compute the array of answers to the LCM function for the 2 lists and a 3rd static number. I tried the following ...
2
votes
1answer
96 views

Find a family of curves

I have a diagram with seven curves (each with a different parameter). My goal is to find a function for the family of curves (i.e. a single function not just for the seven parameters, but for all ...
1
vote
0answers
77 views

Using functions in Solve [closed]

i wanted to calculate the real roots of a function. To my knowledge the function i defined has no real roots, so i expected an emptyset, but instead i got some Root[...#..] answers by Mathematica. ...
0
votes
0answers
48 views

Personal Reminder with Speak capability repeats multiple times

I am trying to create a personal reminder for myself using the Speak function in Mathematica hoping that the computer speaks the task only once at the designated time. However, I have found that the ...
5
votes
3answers
144 views

How to tell Mathematica to get the real-only inverse function?

The problem I have is that Mathematica seems to play better with complex numbers so that the result of N[InverseFunction[Function[x,x^3]][-1]] is ...
2
votes
2answers
59 views

Multiple functions with shared arguments in Manipulate

I am trying to define multiple functions with the same set of parameters and then put them in a Manipulate to simulate their behavior. Ideally it should be something like that: ...
6
votes
2answers
118 views

Getting an explicit representation of the function returned from Interpolation [duplicate]

I am using Interpolation to get an InterpolatingFunction that fits a set of points. For example, ...
0
votes
1answer
44 views

How to apply a user-defined function to a list [closed]

I'm using Wolfram | Alpha Pro; I have a function f[n] = 351n^(-0.7); How do I apply it to each element of a list like {2, 9, 22}? f/@{2, 9, 22} just results in ...
0
votes
1answer
47 views

Interpolate the discrete list into continuous function

I have a data whose list plot shows up following graph I would like to interpolate the missing data and make the function continuous but for particular x-coordinate there is multiple values of $y$ ...
3
votes
1answer
65 views

Are these two functions equivalent?

I checked several cases and saw that two functions are equivalent in these samples. However, are the two equivalent in all cases? Is there a way to check that? Explicit function: ...
1
vote
0answers
28 views

Function with many lines that takes image as parameter not returning same result as if I run the same lines of code

Running the exact same lines of code in a function produces just a return of the original image without any points identified, whereas when I run the exact body of the function line by line it works ...
0
votes
3answers
59 views

How to find the value of a variable using solution of Simultaneous equations? [closed]

I have to find the value of p where p=a1*x+b2*y; using the solution of the equation ...
1
vote
0answers
89 views

Need help interpreting a small block of code [closed]

I have recently "inherited" some Mathematica scripts which I need to interpret to write in some other languages (Maple and C++). I have never used Mathematica before so I have been learning on the ...
1
vote
2answers
65 views
12
votes
2answers
394 views

Fitting a curve to an image object: not a superellipse, not an egg curve.. what else?

I'm facing the problem of quantifying the morphology of objects with such a shape (nannoconids... they are fossils). One of the final goals is to produce a solid of revolution and compute ...
1
vote
1answer
105 views

The basic primitive recursive functions

How can the basic primitive recursive functions be expressed in the Wolfram Language? Apparently here's an example for primitive recursion: ...
0
votes
0answers
73 views

Errro in plotting the results of FindRoot [closed]

I would like to plot the results of FindRoot over certain range of one input. First of all I am sorry that the equation is a bit long and messy. I have tried to ...
4
votes
1answer
164 views

Goal optimization: finding the best combination of capacitors and resistors resulting in given properties

I want to edit @MarcoB answers (because the code he gave doesn't answer the question appropriately)->(the function that need to be optimised is not implemented as asked) But it seems like I am having ...
3
votes
1answer
49 views

A function about prime gaps

I want to define a $f$ function on Mathematica such as this. $f[k]$ gives the smallest $m$ holds $2k=Prime[m+1]-Prime[m]$. For example, $$f[1]=2$$ $$f[2]=4$$ $$f[3]=9$$ $$f[4]=24$$ How can i do ...
1
vote
1answer
53 views

Building functions using WolframAlpha? Any other general examples welcome :)

I want to build my own version of SubsetQ using WolframAlpha to return True or False. ...
0
votes
1answer
34 views

What is the function “oneflag_:0” in this expression? [closed]

The first function Pivotdown can zero out all entries in a column below a desired location. But l don't know the function of “oneflag _0".
0
votes
1answer
88 views

Check an inequality if one condition holds

A = Abs[-1 + 1/(1 + β)] + Abs[-((1 + 2 α + Sqrt[1 + 4 α + 4 α β])/(2 α + 2 α β))] Is A <1 if ...
30
votes
3answers
3k views

Implementing continuous phase/Arg function

In MATLAB there's a function called phase that is just like our Listable friend Arg, but ...
0
votes
1answer
37 views

If Statement in function does not evaluate

I've written a function that should try to simulate a "triangle-wave-signal", given a few parameters. It looks like this: ...
0
votes
0answers
73 views

How to change the built-in function? [duplicate]

As you can see,the original Differences will get {} when your parameter is a list with one element just. Differences /@ {{1, 2, ...
0
votes
2answers
50 views
3
votes
2answers
36 views

How to add Optional Sequence

Note: This question could be duplicate but I couldn't find any so far. It is know that Optional (:) can be use to represent expression if omitted. ...
1
vote
1answer
31 views

Oddity with ToExpression [duplicate]

Is this a bug? ToExpression["3231.432"] 3231.43 I would have expected the following: 3231.432 I am using Mathematica 10.2.0
0
votes
1answer
30 views

Simplification of rational function with Assume function [closed]

I didn't manage to simplify this expression : Simplify[Assuming[x > 0, -((2 Sqrt[x^2/(1 + x^2)^2])/x)]] Do you have ideas why the simplification is not ...
9
votes
1answer
274 views

Interpolation function way off

I have a simple list of data points to which I would like to fit an interpolation function. However, the results given by Interpolation[] gives an oscillating function which is not warranted by the ...
3
votes
1answer
80 views

Map if-function on a list

I need to convert a battery charging mechanism from Excel into Mathematica. This Excel function is about deciding if the charge/decharge rate is positive, then multiply with efficiency factor, ...
14
votes
1answer
292 views

Compability between Graphics coordinates and shifted projections in GeoGraphics

Bug introduced in 10.0.0 and persisting through 10.3.1 or later Edit: My work around is only nice for simple cases with points. More general should include proper polygons splitting on ...
44
votes
3answers
577 views

What bug fixes can be implemented in init.m?

In comments on this question, Mr. Wizard suggested a community wiki to share the bug fixes/workarounds (or possibly other tricks) people load in their init.m. I ...
25
votes
1answer
456 views

In 10.1.0 BenchmarkPlot doesn't work?

Bug introduced in 10.1 This bug was resolved in 10.2.0, but another bug was introduced in 10.3.0 which persists through 10.3.1 or later In Mathematica 10.1.0 and 10.3.0 ...
1
vote
2answers
108 views

How to make function accept list of rules as an argument?

Considering the list of rules: r= {"a" -> "1", "b" -> "2", "c" -> 3, d -> 231, "e" -> 1.25}; I want to have a function ...