Questions tagged [map]
Questions about applying functions or operators to expressions, especially constructs that take advantage of Map (/@) functionality.
424 questions
2
votes
5
answers
213
views
How can I generate the $z^2$ grid-mapping diagram (rectangular grid → curved grid)?
I would like to generate a diagram in Mathematica showing how the mapping
\begin{equation}
w = z^2
\end{equation}
transforms a rectangular grid in the complex $z$-plane into a curved grid in the $w$-...
3
votes
3
answers
286
views
Map a function with a parameter [closed]
I can get the minimum and maximum of a list by using
#[list] &/@ {Min, Max}
I now want to use RankedMin and ...
7
votes
7
answers
368
views
Apply a function onto sublist and include an additional argument
I have myList, a list of triples:
myList = {
{a1, a2, a3},
{b1, b2, b3},
{c1, c2, c3}
};
I wish to apply a function ...
7
votes
3
answers
579
views
Map all possible choices from a set of functions onto a list of arguments
I have a list of functions and a list of arguments:
funcs = {f,g,h}
args = {a,b,c}
I'd like to map one function from funcs to ...
0
votes
0
answers
130
views
Repeated substitute shortened with "Map"
I have an expression e[x,y,z] and like to see all results when picking all independent variables from a fixed set of constants ...
2
votes
2
answers
248
views
Dividing a same value into both the numerator and denominator
As in code1, I was able to find the limit of the expr when m1 approaches Infinity with help of Limit
function. In code2, as expected, the same limit shows by dividing both the numerator and ...
11
votes
6
answers
496
views
How to stop Map or ParallelMap on first error and get the input that caused it?
I want to run a function using Map or ParallelMap over a large list of inputs, but I would like the evaluation to stop as soon ...
1
vote
3
answers
229
views
Faster way to apply a list of numbers to a list of functions
I'm trying to apply two lists random numbers to a list of lists of functions, retrieve a Boolean result for each application, and test for AND coincidence between results. I have a working method, ...
3
votes
3
answers
303
views
Applying square function to specific rows of a matrix
I'm having a problem mapping a squaring function to specific rows of a matrix.
Below are the positions I want to conjugate in the matrix:
...
1
vote
4
answers
163
views
Iterating (looping) over nested list (using Map?)
I would like to iterate over a nested list of the following format:
q={{1,{r1,t1,p1},{}},{2,{r2,t2,p2},{}}}
where r,t and p are numbers (spherical coordinates).
In ...
8
votes
4
answers
480
views
Is it acceptable programming practice to reference a part of a slot (#[[1]], #[[2]], and #[[3]], for example)? If not, what alternative should I use?
Suppose I have a list of lists -- specifically, a rectangular array/matrix called myList:
...
0
votes
2
answers
191
views
Replace a Do loop with a Map. (Nested Map)
I have a Do loop which has a Map inside of it. I would like to replace the loop with a Map creating a nested Map structure.
The initial code that does the job is:
...
0
votes
1
answer
126
views
"{" cannot be followed by "[ " when using pure function [closed]
It may be a basic question, but if I use my pure function like the 4th line below, I got a syntax error. Could I know what I did wrong?
...
4
votes
3
answers
217
views
How to map a list of elements to a list of positions of a matrix
I have an all zero matrix
zeromatrix= ConstantArray[0,{4,4}]
I have a list of non-zero positions and a list of non-zero values
...
4
votes
3
answers
480
views
How to apply a function to specific rows of a matrix
I want to apply a function:
f[x_]:=x^2
I want to map it to certain values in a matrix, say
...