# Questions tagged [functions]

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

2,814 questions
Filter by
Sorted by
Tagged with
329 views

### Custom operator form for system functions?

There are some functions for which an operator form would make sense but isn't implemented. For example, I'd like to make this work: RandomSample[3] @ Range[10] ...
259 views

### Choosing among different function definitions without sacrificing speed

I'm working on some code that numerically integrates a function, let's call it G, which calls another function, F, that can be ...
2k views

### Divide all but the maximal element in a list by 10?

I have a list of numerical data, and I want to write a program that will keep the maximum as it is, but reduce the rest by certain factor (such as 10). For example: ...
5k views

### Finding maximum or minimum of implicit functions

is there any built in function that can be used to find maximum or minimum of implicit functions? For example, if we have the equation $$x^2 + y^2 = (2 x^2 + 2 y^2 - x)^2,$$ then we can visualize the ...
922 views

### Assessing argument type in set delayed function definitions

I'm wondering how to properly assess the type of arguments passed to functions defined with :=. I want my functions to be the most efficient, unambiguous and clear ...
2k views

### Building a Noisy Function

Here's a nice function with a nice plot: f[t_] := Exp[-Abs[t]] Sin[t]; Plot[f[t], {t, -10, 10}, PlotRange -> All] What I would like to do is to make it noisy.....
712 views

### How to make the suggestion box appear?

When you type a function in Matlab, quickly a suggestion box comes up showing functions similar to the one you're typing. I thought that Mathematica didn't have this but one day, I typed half of a ...
1k views

### Why does Hash return different values in Version 7?

This function does not work correctly for me. The generated Gravatars do not match the ones actually produced by using the corresponding address. The problem was traced to differing output from the <...
850 views

### Finding and visualization of branch cuts and branch points

Is it possible to determine branch cuts and branch points for complicated functions using mathematica Iam trying to determine the brnach cuts and branch points of this complicated function We have ...
3k views

### How do I find the elements in a list that return the highest value for a function?

Suppose we have a list of values and a function f. I want to find which of the elements maximizes the return value of the function in Mathematica. Let call the ...
2k views

### Which Mathematica function has the longest name (by character length?)

I came across DamerauLevenshteinDistance[u,v] in the documentation center so that got me thinking: Which documented Mathematica function has the longest name? ...
710 views

### What is the use of FullForm in Mathematica?

I would like to know where this "FullForm" in Mathematica will be useful. Kindly provide some examples. I just started learning Mathematica. If my question is wrong or not correct. I'm sorry about ...
681 views

### Remove versus ClearAll

What is the difference between Remove and ClearAll? I thought that "not being recognized by Mathematica", which is the effect ...
8k views

### “do … while” loop equivalent in Mathematica [closed]

Have I missed something or is there no built-in which mimics the behaviour of do ... while loop? I am looking for a construct that evaluates procedure once and ...
24k views

### Function that takes another function inside

Looking at this QA, I'm trying the following - 2 functions (r in vector format) using Theta { A, 2 } functions (sorry for the inconsistent names...). ...
1k views

### How to add an interpolating point to InterpolatingFunction?

Suppose I have an InterpolatingFunction object defined on $[\epsilon,1]$; let's call it f. What is the best way to construct a ...
394 views

### What does IndexBy do and how exactly does it work?

I just saw the function IndexBy in the autocomplete suggestions and I was curious to know exactly how it works. Unfortunately, there's no trace of it in the ...
4k views

### Using RegionFunction on multiple plots

I realize that the Plot function can plot multiple functions of x at the same time, using { }. I also know that the ...
1k views

### How to test if optional argument has been given?

I understand that the last call (f[1]) returns True because arg does not exist and thus <...
1k 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 $kx,kz$-...
4k views

### Prevent Part[] from trying to extract parts of symbolic expressions

If you have a list, e.g. {1, 2, 3} then you can extract the $k$th part using Part (...
563 views

### solve ODE with divergencies

The solutions of the second order differential equation $$\frac{1}{\eta}\frac{d}{d\eta}\left(\eta \frac{df}{d\eta}\right)+\left(1-\frac{s^2}{\eta^2}\right)f-f^3=0$$ is shown in Fig. 5.2 below, for ...
446 views

### How do I get a general form for n-th derivative of a function? [duplicate]

I tried the following but it basically returns unevaluated: ...
651 views

### Defining Tags in Reap

I am trying to use Sow/Reap to replace Append in my code. The problem is that I need to ...
250 views

### KeyDrop does not respect Key in V11

KeyDrop[<|a -> 1|>, Key[a]] <|a -> 1|> ...
781 views

I have a dynamic list of function names, like {f1, f2, f3, ...}, and they will enter in computation in various forms ...
2k views

### Find the minimum integer r such that $(10^r - 1)/37$ is an integer

I know Element[(10^r - 1)/37, Integers] tests the condition. So what is the command that gives me the minimum integer value r ...
1k views

### How to find range in which a number falls, from given list of numbers?

How can one find the range in which a number falls, from given list of numbers? ...
383 views

### Does function call via @ ignore HoldFirst attribute?

I was trying to test whether using func[x,y] is the same as func[#,y]&@x: ...
1k views

### Generating Random Real numbers with certain numbers not included

I'm writing a program that i need 1000 real number between -3 and 6. the code that I used for generating and saving them was l = RandomReal[{-3, 6}, 1000] But I ...
568 views

### Why does MatrixFunction with Sinc return this error?

The following: mat = {{1., -3, -2}, {-1, 3, -2}, {0., 0., 0.}} MatrixFunction[Sinc, mat] returns: ...
3k views

### Plot the minimum of a list of functions

This is my first question on any stack-exchange site and I'm also very new to using Mathematica software so please excuse/correct me if I mess up. I would like to take a list of functions of a single ...
561 views

### Map a function of several arguments

I have three lists, e.g. list1 = {{a,b,...}}; list2 = {{1,2},{3,4},...}; list3 = {{x,y},{z,w},...}; and a function ...
2k views

### Growth of functions

Does somebody know if Mathematica can be used to calculate the growth of functions, that is in Big O, Theta, and Omega and find proper $n_{0}$ and $c_{1}$, $c_{2}$ respectively?
963 views

### Difference between Evaluation āŗ Quit Kernel and Quit[]

What is the difference between Evaluation āŗ Quit Kernel and Quit[]? Both seem to quit the kernel (and clearing all definitions)...
450 views

### Vertex descendants subgraph

Keywords: vertex, ancestors, descendants, subgraph, directed graph, flow subtree So let's say we have a TreeGraph: ...
471 views

For convenience I'm trying to add an extra property to CountryData ...
306 views

### Why isn't Lookup treated like other symbols?

With Mathematica 10, I wanted to overload Lookup using TagSetDelayed, but it doesn't work. For instance, if I define two objects ...
485 views

### Function as an option to a function

I am new to mathematica ,so this question may seem a little naive. I know how to use the option as an argument to a function, we can define an option by using ...
502 views

### What's a good style for inheriting Options[] of built-in function?

Options[myPlot] = Options[Plot]; myPlot[args___] := ... When defining a "wrapper" function like the above, I'd like it to inherit the ...
289 views

### Assumption on the range of a function

I'm using value-defined function as set of parameter, i.e. f[1] ===> first parameter f[2] ===> second parameter f[3] ===> third parameter etc. I would ...
2k views

### What is the difference between prefix/postfix notations and map?

I am new to Mathematica and just experimenting with the different programming constructs. I have been looking at Map and how to evaluate a function for a list of ...
261 views