# Questions tagged [map]

Questions about applying functions or operators to expressions, especially constructs that take advantage of Map (/@) functionality.

413 questions
Filter by
Sorted by
Tagged with
221 views

While adding shadows to the spiric sections of a torus using the The answer to the question given by Daniel Huber, I faced a problem. Instead of being well separated as previously, the sections ...
• 2,644
1 vote
60 views

### Define certain argument in functions which depend on several arguments and built in a list

I got confused working with list of functions of two variables. I construct few lists of functions, one is vector of functions List1 and another is 2D list of ...
• 336
1 vote
138 views

### Cross product of a vector and a matrix

I defined a symbolic matrix with vector elements as: ...
• 105
147 views

### Finite Time Lyapunov Spectrum (FTLS)

The stadium billiard is a $2D$ chaotic system. We know this by studying its specular reflection patterns and Poincare section (or Poincaré-Birkhoff coordinates (PBC)). However, both methods are ...
• 2,644
82 views

### Log scale of y-axis is still very small [closed]

I am trying to use LogPlot of Mathematica to rewrite only y-axis (not x-axis) of the plot as log scale. But the y-axis is still very small. By the following code <...
• 31
406 views

### How to stop mapping on true results for large lists?

Assuming I have a long list (real data with more than 100k elements). I have a function that I want to apply to the list, for example, EvenQ. I want the mapping to stop once the result for one element ...
• 795
36 views

### Map Integrate onto one single term

This is related to the question (Integrate many simple terms fast) I had before, where Nasser gave me an answer which worked 'most of the time' but not always. Context: ...
218 views

### How to highlight top N elements in each table column?

I have tables with column and row headings, similar to this one: table = {{"",0.1,0.01}, {{1,0},1,3}, {{1,1},2,4}} I want to highlight top N elements in ...
142 views

### Want Map function to apply over sum of terms but not product

For a given function F, if I use Map[F,a+b+c d], Mathematica returns, as desired: F[a]+F[b]+F[c d] ; However, for ...
1 vote
36 views

### Change specific elements of a list [closed]

I have currently looking to change specific elements of a list. I saw that you can apply a fonction to an element if you know it's position as shown in this question : Apply function to specific ...
478 views

### Accumulated instance count of each list element

Given a list with repeated elements, for example: list = {m, i, s, s, i, s, s, i, p, p, i} I'd like to determine, for each position in the list, how many times the ...
• 1,335
189 views

### Table with additional conditions for the generated objects

Suppose that I have a function prob[n_] := Table[Subscript[p, i], {i, 1, n}] that generates tuples with n entries that correspond to probabilities. What I would ...
1 vote
80 views

### How can I make a map to solve in a list of coefficients of an equation?

I have a list list = {{2, -4, 3, 1, -2}, {2, -3, -4, -1, -2}, {2, -3, 4, -1, -4}} and ...
• 1,056
197 views

### How to express a list of lists of rules as functions?

Given a list of lists of rules as follows: ...
• 6,233
254 views

### How to map an unbalanced list of lists as functions?

Given: Map[f, {{a, f, h, m, n, k},{a, b}, {z, d, f, h, k}, {c, d, e}, {c, p}}] I like to have a list of ordered functions as ...
• 6,233
59 views

### Understanding and Fixing Image Encryption Using Henon Map Resulting in Original Image, Not Encrypted Image

I'm reaching out to this community in my quest to understand and improve an image encryption process using the Henon map. I have created the following Mathematica code to encrypt an image: ...
• 1,049
1 vote
53 views

### Extracting integers from a Dataset containing variables

I want to extract two vectors DataA = {1,0,0,0} and DataB = {0,2,5,0} from a dataset. I tried a few ways including using the dataset and ...
• 157
197 views

### Python Code to Mathematica for Classical Map of Kicked Top

I am trying to convert this Python code for Classical map of kicked top to Mathematica. For a single trajectory, I am able to ...
• 2,644
802 views

### How to write a duplicate mapping function?

I need a function MapDuplicate that maps a function on all the duplicates in a list. Consider the following list: ...
• 9,523
336 views

### Applies f to all locations other than the specified location

MapAt[f, <|"a" -> 1, "b" -> 2, "c" -> 3, "d" -> 4|>, Except["b"]] I want to apply the function <...
• 26.9k
265 views

### Enumeration of a nested list

My problem is consisting of following: I have a nested list of following form: {{B, v ** v, b ** B}, {b, B ** b}, {b ** B, v ** v}, {}} And I want to enumerate ...
• 69
195 views

### Efficient way to MapApply for Tensor

I need to Map a function with certain arguments $f(\alpha,\beta,\gamma,\delta)$ onto a whole tensor. My current approach looks like ...
• 124
1 vote
65 views

### get the first from a list using slots [closed]

Problem. I work with a list and want to get the first element. For specific reasons I want to use # in combination with Map For example ...
• 2,855
127 views

### Map, applying list in a defined function

Suppose I have defined some function (This is arbitrary) F[alpha_,a_,b_,c_]:=List[alpha,a+b+c] I want to apply this F for a given huge list of sets ...
• 923
59 views

### How to combine multiple plots via Table when a map is being applied? [closed]

This question is based on this answer ...
• 2,433
49 views

### Creating a heat map in a circle according to positions on x and y axes [duplicate]

I would appreciate advice on writing code. I need to draw a heat map according to positions, it indicates object trajectory so the order is matter. The positions are saved in a nested list. An inner ...
• 317
1 vote
51 views

### Comparing performance of ParallelMap with pure function

Test data are here: q = CloudGet[ "https://www.wolframcloud.com/obj/874e3b18-808a-404a-aaa0-4e3ad1ac4668"]; I construct interpolation and an equi-...
• 4,006
317 views

### Can I exit a Map over a list of data pairs?

I've written a function, which I intended to Map over lists of some 8,000 element pairs. I created the "toy" code below to illustrate my problem. ...
• 14.5k
81 views

### Creating a mesh map with river cross-profiles

I am trying to create a type of 3D mesh map using multiple cross profiles/cross-sections of a river. I have the longitude, latitude, and elevation imported, with two examples shown below: ...
643 views

### How can I "multiply" nested lists?

Given two nested lists alist={{a,b,c},{d,e,f}} blist={{r,s,t},{x,y,z}} How can I get ...
• 777
152 views

### Substituting the element of a list into a list that contains the index position

I see similar questions for lists and indexes and manipulating with Thread, MapIndexed,etc., but I do not see how to do a substitution. I have a list of coordinates for a geometric object and a list ...
• 55
219 views

### Map function with evaluated and unevaluated parameters

Let's consider a function with evaluated and unevaluated arguments inside: list1 = {1,2,3} list2 = {x,y,z} fun[list_]:={list,ToString@Unevaluated@list} When I use ...
• 534
75 views

### Trouble Mapping a Geometric Transformations over a List of different types of Graphics Objects

I am working on some code that allows me to auto-rotate graphics (including ParmetricPlot3D and Plot3D graphics) objects while preserving mouse dragging in a smooth fashion. It works great. The code ...
• 5,565
111 views

### Simplify Map on a list of lists

I have the following example list of matrices: a = {p Table[RandomComplex[], {2}, {2}], q Table[RandomComplex[], {2}, {2}]} where p and q are real variables. I ...
• 987
102 views

### MapAt with pure functions

Consider expr = Hold[1 + a + x + b + c + y + z]; idxes = {{1, 3}, {1, 4}}; Q1. I don't understand why ...
• 572
1 vote
94 views

### Specify index of array for Map operation

I want to calculate the determinant along the last slice of a 3-dimensional array. So for I do this by slow the Table command. I know that for time reasons I should ...
796 views

### How to create a matrix of paired values from two matrices?

I have two matrices. They are, m1={{a,b},{c,d}}; m2={{w,x},{y,z}}; I want to create a matrix of paired values that looks like this, ...
188 views

### Apply function to specific elements in list [closed]

Say I have a list like myData={{1,m1,v1},{2,m2,v2},{3,m3,v3},{4,m4,v4}}. It could be a dataset, where the first and second variables in each tuple is as desired, ...
• 143
197 views

### Converting specific positions of a List into Sublist

Suppose I have a List of numbers: num = Range[5] I want to combine the second and the third element into a sublist to get the result as {1,{2,3},4,5}. I tried ...
• 2,433
144 views

### Complicated double mapping over nested list

I have a list that each term consist of two parts. First part is a graph and second is a list of pairs of vertices that I want to find graph distance of. ...
• 19.9k
221 views

### What should mapping over a number or symbol produce?

I expected it to be an error (i.e., produce an error message), but Map[f,num] is num. Why is this the correct behavior? If it is ...
• 13.8k
475 views

### How can I create an atomic head or treat some head as atomic during Map?

For example, Map[g, {0, {h[1, 2, 3]}}, {-1}] gives {g[0], {h[g[1], g[2], g[3]]}} I want a ...
• 17.2k
95 views

### Mapping Part to a List [closed]

I have a list, x, where each member is itself a list of 2 coordinate points. Sometimes a member is a list of only 1 point, sometimes it is a list of more points. Note that the last member below is a ...
• 357
560 views

### How do I map a function pairwise?

Given a list of pairs: data = {{a,b},{c,d},{e,f},{g,h},{i,j}} I need the moving map: MapPair[F,data] ...
• 19.7k
602 views

### Maps between finite sets

With SageMath, one can do FiniteSetMaps(["a", "b"], [3, 4, 5]) to get all maps from {a,b} to ...
• 415
710 views

### Monitoring Apply / @@@ over large lists

How to monitor and/or print partial progress of Apply, e.g. f @@@ list? I have found answers using Map (e.g. this nice trick using Echo, or this general trick), but ...
• 243
1k views

### How can I apply a function only to even-index elements of a list?

A = {1, 2, 3, 4, 5} and, Dd[P_] := P + 1 How can I map "Dd" into "A" such that the outcome is: {1, 3, 3, 5, ...
• 83
712 views

### Smart way to remove rules from lists, leaving just values, specifically from FindMinimum output

I would like to know if there is a direct way to remove the rules from a list of rules. I know that, simply, this can be done with: ...