Questions tagged [map]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
29 views

Contour plot of a constant y?

I have the following data points, ...
1
vote
1answer
38 views

How to separately pass elements of a 3D list as part of the arguments of a function

Hi I have a function which its arguments have the form F[a,b,c,d,e] but the 2nd to 4th arguments are in a list of the form R={{{b,c,d},{e,f,g}},{{h,i,j},{k,l,m}}} how can I pass these elements as ...
0
votes
1answer
39 views

Contour plot with x, y and z values?

I have x , y and z as x = List[1.355, 1.357, 1.359, 1.36, 1.357, 1.355]; and ...
0
votes
0answers
31 views

Converting 1D map into first order differential equation for bifurcation diagram code

I have existing code to plot bifurcation diagram for coupled first order differential equations. It seems to work for coupled differential equations. To test the code further, I use the simplest ...
0
votes
0answers
31 views

Trouble with bifurcation of differential equation

The code for bifurcation is written in such a way that it will allow plot bifurcation for any number of differential equation. Thus I am trying to avoid maps and iterations. Unfortunately it does ...
0
votes
2answers
62 views

Add gaussian noise to 2D Point

I implemented a program for a camera calibration in Mathematica with with prototypical data to see if my calibration works. Here I converted 3D object coordinates into 2D sensor coordinates. I have ...
0
votes
0answers
28 views

How to make a manipulatable map that can change color?

I want to color the world map differently according to how much the number of each country. For example, USA using renewable energy for 20% should be colored lighter than Canada using renewable for 50%...
0
votes
0answers
22 views

Adaptation of existing code to multivariable system

I am trying to adapt the existing code from "Mathematica package for analysis and control of chaos in nonlinear system" by Gutierrez. This existing code calculates the Lyapunov Exponent by ...
1
vote
0answers
52 views

How to find N most populous cities in each state with TakeLargest and Entity Functions without waiting forever using Caching?

I am interested in using Entity Functions such as EntityValue, FilteredEntityClass, EntityFunction, EntityClass, EntityList, and GeoEntities to help me find N most populous cities in each state. I ...
0
votes
1answer
62 views

Mapping data from 2 files imported

I'm not in prog major. This course is needed as an elective for another major. Thus any help is appreciated. DataA and DataB ...
5
votes
1answer
243 views

What's the difference between @ and /@? [closed]

The @ and /@ functions do the same thing: ...
1
vote
0answers
75 views

compiled function not mapable

I am currently working on speeding up a larger project and thus using FunctionCompile. I have come across the issue that a manual input of list elements produces a valid results, however if I try to ...
2
votes
2answers
101 views

How to split many controls in Manipulate into multiple columns (saw some potential bugs)

I need to use Manipulate[] with many controls, because I have around 40 parameters which I want to be able to alter. Since the number is too large, I want to split these controls into multiple columns,...
2
votes
0answers
73 views

How to use Select and MemberQ together with Map correctly?

I have a list with quite a few elements. Each element is a rule of the type vector-> number such as {1,2,3,4}->1.435 and ...
1
vote
0answers
53 views

Map a function that uses the lists indices as arguments

Suppose I have a function f[x_] that I want to Map over somelist (assumed to be one ...
1
vote
0answers
104 views

How to limit the cpu usage of Mathematica?

I am runing mathematica with ParallelMap[], on a win10 computer with 8 physical cores. The cpu usage always rocks up to 100%, though ...
0
votes
0answers
59 views

Evaluate a function with 3 different variables for the whole list of each variable

I have a function with 3 variables f[t1,t2,t3] Each function has a list of values ...
0
votes
0answers
39 views

How to map the outputs to different output lines?

I have the following code GraphIt[n, n2, IR, #] &/@ vanishpts where the function GraphIt print something, and returns a graph. I don't want my outputs to be ...
2
votes
1answer
71 views

Considerations for Compiling and Parallelizing Code Outside or Inside Map[]

Assume f as well as Map[f,list] are parallelizable and compilable, such that parallelization and compilation give significant ...
2
votes
2answers
85 views

Mapping list elements without using Table function

How could I generate the following list of points using some function or mapping without using the table function. ...
3
votes
1answer
65 views

How to Map over a BlankSequence? [closed]

I would like to replace any function f[x, y, ...] in a certain expression with the same function with all its arguments squared, i.e. ...
4
votes
3answers
158 views

Curious about Mapping over multiple multiple arguments [closed]

To my shame, I have discovered the power of Map quite recently and since then I have been using it more and more. But increasingly I find myself trying to use ...
3
votes
0answers
66 views

How to digitize a vector field?

Is there some way that I can digitize both the direction and the magnitude of a vector field accessible in JPEG format? To clarify what I mean, I want to have the numerical value of: 1)magnitude and 2)...
3
votes
2answers
67 views

Applying transformation rule for corresponding indices?

I have two lists, that looks like below list1 = {a, x, b, x, x, c}; list2 = {2, 3, 4, 5, 6, 7}; Any time there is an x in the ...
0
votes
0answers
70 views

Iteration limit exceeded

I am trying to adapt the following piece of code (coming from this answer): ...
1
vote
1answer
75 views

how I should use `MovingMap` on a `Dataset`?

I am aware of How would I use Map on a Dataset column? still I cannot see how I should use MovingMap on a Dataset. Even the ...
0
votes
1answer
38 views

Recursive addition of vector list to last elements of vector lists

This question refers to an extension of Add list of vectors to list of vectors recursively . I tried hard to complete the problem but now I got stuck. I have vectors ...
4
votes
2answers
124 views

bind specific 'Slots' to specific 'Map'

Is it possible to construct a pure function using multiple slots, with the following concept :       Binding   specific slot    to    specific apply or map For example : In this example, To ...
2
votes
2answers
122 views

Restrict kinds of heads when dealing with level concept

In[1] Map[(# + 7) &, {a, 3 b, {c, d}, e}, {2}] Out[1] {a, 10 (7 + b), {7 + c, 7 + d}, e} But I want feature like ListMap : ...
0
votes
0answers
41 views

calculate differences of a list using slots

I want to calculate the differences between the numbers of a list. One way to do that is using 'Differences'. For example: L = {1, 3, 6, 9}; Differences[L] this ...
0
votes
1answer
41 views

How to prevent small locations from being plotted as points when using GeoListPlot?

When a location is too small, GeoListPlot marks that location using a point on the map. For example, ...
1
vote
1answer
69 views

Manipulate mapping on lists

For some function f, consider the following expression: ...
15
votes
1answer
929 views

Metropolis-Hastings Algorithm - Significantly slower than Python

I would like to code a Metropolis Hasting algorithm and thought I would get the general scheme of things going with a toy example. I think I got it running but my Mathematica code runs significantly ...
0
votes
0answers
47 views

How to change Point options when using Map?

I want to change the point size of the points I am plotting in the code below, but wherever I place the PointSize[] option it doesn't like it. The code is part of a larger program, which generates a ...
1
vote
1answer
45 views

loop execution time difference after Map operation

I am box filtering data from a DNS simulation. When filtering the original data read from a file, this is fast. When filtering a function of these data after applying Map, it is 10 times slower. If I ...
1
vote
1answer
90 views

Optimal way to evaluate a function over many points

This piggy-backs on my previous question: Parameter space search routine is too fast? I am looking for a fast way to evaluate a symbolic list over many points. So lets say I have a list of symbolic ...
0
votes
1answer
46 views

How can I plot various points on a world map and compare distances?

How can I plot various points on a world map and compare distances? For example, the distance between Jerusalem and Westford, MA compared to the distance between Westford, MA and Recife, Brasil? Then ...
4
votes
2answers
186 views

Maximum of all distances between any pairs of vertices of a random triangle

Given a set $S_n$ of $n$ points selected uniformly at random in a $d$-ball, I want to estimate the average length of the longest side of a triangle having as vertices any three distinct points of $S_n$...
0
votes
1answer
40 views

Replace Table with a fast matrix operation to create for matrices A, B the tensor (b_{ij}A) and similar questions

I have two (nxn)-matrices A=(a_{ij}) and B=(b_{ij}) and I'd like to create the (nxnxnxn)-List C=(b_{ij}*A) so e.g. ...
6
votes
3answers
188 views

Nested lamdas: MapThreading a MapAt lambda

Consider a set of (here) 3 series ...
4
votes
1answer
82 views

Key-dependent maps preserving association

Suppose I have some association a0 = <| key1 -> val1, ... |> and some function f[key, val]. I'd like to produce the ...
1
vote
1answer
29 views

Changing PlotStyle while mapping ListLinePlot at several datasets [closed]

Assume that I have several datasets in a matrix and I want to plot them using ...
3
votes
2answers
257 views

How to write a positive function as sum of positive terms only

A multivariate polynomial function can be written in a certain form (x^m (1-x)^n y^k + ... ) if the function is Positive in the whole domain and contains a finite ...
2
votes
0answers
50 views

Map Inverse Ordering on Matrix [duplicate]

I have an matrix (symmetric, but any $n \times n$ will do) $$A = \begin{bmatrix} 0 & 4.5 & 6 & 5.5 \\ 4.5 & 0 & 4 & 3 \\ 6 & 4 & 0 & 5 \\ 5.5 & 3 & 5 &...
4
votes
1answer
162 views

Plotting conformal mappings: $(x, y) \mapsto (x^2, y)$

I'm currently studying transformation geometry, and I've been trying to figure out a good way to plot conformal mappings on $\mathbb{R}^2$ of the form $$ \mathbf{f} : \pmatrix{x \\ y} \mapsto \pmatrix{...
2
votes
3answers
87 views

Multiple Calculations in a condition

I want to add and subtract 3 from a list. pos = {82,84} If[# > 3, (# - 3) && (# + 3)] & /@ pos the output I want: ...
0
votes
1answer
77 views

Removing curly brackets in an argument of ArcTan [closed]

I have list of number pairs l = {{1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0}, {-1, -1}, {0, -1}} of which I want to take the ArcTan ...
4
votes
1answer
174 views

Why Does Parallelization Not Speed Up these Seemingly Well-Parallelizable, Simple Functions?

Original Example Consider function f, a parallelized version fPar, and a coarsest-grained parallelized version ...
3
votes
2answers
56 views

Map vertex id to vertex coordinate

I want to map vertex labels to vertex coordinates stored in two variables. vl = {6, 9, 12} vd = {{1011, 1127, 420}, {950, 1052, 404}, {780, 1033, 470}} I tried, <...
1
vote
2answers
101 views

How to pass arguments and options of a function when using Map?

Suppose I have a list in which I need to map a function to a list. Also suppose that function takes several arguments and even more options (such as styling). How would I pass all arguments and ...

1
2 3 4 5
8