Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [map]

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

1
vote
1answer
47 views

Replace second derivative with product rule

Suppose that after some calculations, I find a[x]*D[g[x],x,x]+b[x]*D[h[x],x,x]+c[x]*D[j[x],x] What sort of operations do I need to do in Mathematica such that ...
1
vote
1answer
22 views

Mapping the FindMinimum function over a matrix

I'm quite new to Mathematica and so still trying to work out how to use some of its syntax and functions. I have a function for the free energy of a generic system with two order parameters. I am then ...
0
votes
1answer
26 views

Create a list to Plot from a list returned by Solve

I have a list of 8 items the form: ...
1
vote
2answers
71 views

How can I iterate across a list of triples?

i just started to use Mathematica and I`m completely new to programming. So i'm some kind of noob in the purest form.. I'm trying to transform a coordinate system into a different one. I'm using <...
6
votes
1answer
65 views

How to properly Abort from within a ParallelMap?

If a condition is met within a sub-kernel in the function being mapped, how does one cancel the whole ParallelMap operation? ...
0
votes
1answer
47 views

Using elements of list to solve a differential equation

I have created a list as shown in picture. the digits inside f are values of a and q respectively. I want to solve the Mathieu equation.....
2
votes
0answers
29 views

Map a function at the lowest level [closed]

How do I map a function to the lowest level of any given nested list? As an example, how do I create output from input in the ...
2
votes
1answer
56 views

Fast and Listable Piecewise function

I am writing a simulation where I have an array with ten columns and on the order of millions of rows, for which I need to iterate on the order of ten thousand times, making computation time a major ...
0
votes
0answers
30 views

Help with weird behaviour of Map[Take… on large lists

Lets say I create a giant list: tmp=RandomReal[{1,10},600000000]; Now I want to take 10 random sublists of length 150000: ...
4
votes
1answer
139 views

Apply Max to each element of a list [duplicate]

I have a list a = {1, 8, 0, 6, 5, 3, 5, 2, 2, 5} I want to generate a new list whose elements are the same of a if it's bigger than 5, or 5 elsewhere. I managed ...
2
votes
1answer
108 views
1
vote
2answers
69 views

How to caculate Position Cost Price in given trading list quickly?

Given a simulated trading list as ...
0
votes
1answer
23 views

Table of convolutes

Inputs Start with a vector $x\in\mathbb{R}^{n}$, and a vector-valued function $f:\mathbb{R}^{n}\mapsto\mathbb{R}^{n}$. Output Given some $k\in\mathbb{Z}^{+}$, what are elegant ways to produce the ...
10
votes
1answer
89 views

Parallelize[MapIndexed[…,Association[…]]] returns broken result

Bug introduced in 10.0.2 or earlier and persisting through 12.0 Confirmed: CASE:4041910 Consider the following example: ...
1
vote
1answer
48 views

Mapping over a piecewise function

This is a followup to a question I posted earlier today. Suppose you have a piecewise function such as "snap=max[x,0]= x if x>0, 0 otherwise". Then you would think that it must be straightworward to ...
0
votes
0answers
49 views

Using Map function with NDSolve

I would like to solve a set of differential equations but vary one parameter, KieP, between 900 and 1100. The solution for a given parameter has many peaks. I would then like to interpolate between ...
0
votes
1answer
49 views

How to map a function to a specfic level spec

I'm rewriting a function into a manipulatable graphic and while I'm happily surprised with how concise functional programming can be, I'm having trouble mapping the anonymous function ...
13
votes
2answers
450 views

Project map to a particular shape

I want to project a map to a particular shape, like a circle or ellipse. For example, let's imagine we want to project a map of the continental United states so that its outline is that of a circle. ...
0
votes
0answers
89 views

Operation on sublists with multiple arguments

I have a list and add only the values which are > 0 with: Total[Cases[mylist, x_ /; x > 0]] How to do this if I now have a list of sublists? ...
1
vote
0answers
70 views

Run function as loop over two matrices

I'm still wrapping my head around Mathematica syntax. I have a matrix clustersAll that looks like ...
1
vote
0answers
81 views

Understanding Maps and slot

Going through some old code I found this line: ...
0
votes
0answers
71 views

How to give a function multiple variables in a mapped and nested list?

I come from python (not advanced tho), and have been learning mathematica. I'm currently struggling with the following code: This is a basic version of what i wanted to implement: ...
3
votes
4answers
168 views

@ and Sequence ( and /@ ) [duplicate]

list = { {a,b}, {c,d}, {e,g} } How to efficiently get { f[a,b], f[c,d], f[e,g] } I tried various combinations using ...
2
votes
2answers
114 views

Clear variables inside Module

I have a function that uses Module. The function takes as input a .csv that can have as many columns as it wishes to, and it ...
3
votes
1answer
53 views

Can I Use a List To Position An Arbitrary Number of Graphic Objects?

I can use a function to compute the positions of individual nodes of a neural network based on how many there are in each layer (nodesPerLayerList below). Now I want to display them all in position. ...
6
votes
2answers
256 views

Applying functions to lists

I have a few expressions $f(\theta,x)$, $g(\theta,x)$, $h(\theta,x)$ in terms of two variables, an angle and a length. The angle goes from $-\pi/2$ to $\pi/2$ and the length from 200 to 1500. This is ...
0
votes
2answers
109 views

Mapping slots over lists

In the meantime I'm accustomed to write special character orgies like D[%,#]&/@L (to quickly fish out the coefficients of the last input with respect to ...
1
vote
0answers
25 views

Color filling by GDP in a map

I would like to have a tool where one can type in a minimum GDP level and then every country that has this minimum level gets filled with color.
1
vote
2answers
63 views

How to I use Map to apply a defined function to a list?

Problem: How to map a function onto a list. My (example input: mylist = {{1, 2}, {3, 4}} gg[x_, y_] := {N[x + y], N[x y]} Map[gg, mylist] Expected output: ...
1
vote
1answer
59 views

Angle between one vector and a list of vectors [closed]

I have one vector v1 and one list of vectors v2. I want to find the angle between them (see below): ...
8
votes
1answer
116 views

How to Parallelize a simple MapAt?

I have a simple map I would like to parallelize (4x speedup for my 4 cores): ...
1
vote
1answer
65 views

Extracting the graph of Keys in nested Associations

Related to this q: Extract all Values from nested Association How to extract the direct graph of all Keys in nested Associations...
0
votes
2answers
60 views

Multivariate map

I have a multivariate function that I want to map into a triple of variables. ...
13
votes
3answers
301 views

MapThread Not Mapping on Ragged Array

Update: WRI Support has considered this a missing feature of MapThread instead of a bug. A request to update MapThread to ...
1
vote
1answer
82 views

Removing outer concentric circle picked up by ComponentMeasurement

So I have performed EdgeDetect and ComponentMeasurements on my images and obtained a pretty good elliptical fit. However, the black shadow of the beads in the image is being picked up by ...
2
votes
0answers
42 views

Error when using Map in Pure Function [closed]

I'm trying to solve Project Euler 21 My solution is as follows: ...
4
votes
2answers
237 views
2
votes
0answers
32 views

Apply all possible permutations into a function [duplicate]

I need to create a function that returns all possible trebles of integers that sum up to a given number. For example, is n=2 then I need something like this: ...
9
votes
5answers
850 views

Map every second element of a list

I've loaded a CSV: ...
3
votes
1answer
135 views

Mapping multiple function on list [duplicate]

I know what you may be thinking so I use the code below to demonstrate what I intend to do. ...
1
vote
0answers
43 views

Coverting a list of products to a list of strings

I am trying to find a way of converting a product of variables to a string, eg. if I have abc... I wish to obtain "abc...". I ...
1
vote
1answer
81 views

Pause when mapping [closed]

I am mapping a function across a list, but would like to pause before each item. For instance: function[variable_]:=( variable * 2 ) function/@{1,2,3} would give ...
0
votes
0answers
72 views

Variables defined modulo $\pi$ and avoiding singularities; phase plotting for a map

I have the following $2$-dimensional implicitly defined map ...
4
votes
1answer
155 views

Apply a function to a list that is a subset of sublists

My MMA fu is very stale, and I don't seem to be able to see a simple way to apply a function across a subset of a list. Specifically in the following data, I want to apply ...
1
vote
2answers
152 views

Comparing elements in a list of lists

I'm stuck with yet another list question. The basic gist: I have lists within a list like so: ...
1
vote
2answers
119 views

Mapping plots with multiple parameter values

The model I am trying to copy is this(not really necessary to look at it): https://www.wolfram.com/mathematica/new-in-10/plot-themes/table-of-plots.html but my problem is slightly different and I ...
2
votes
1answer
384 views

Mapping function with multiple parameters

So I am trying to print out a table using the map function. My code looks like this: ...
0
votes
2answers
145 views

Replacing For loop with multiple iterator with Table

I have written code for calculating cristofell symbol using for loop with 3 iterators for each coordinate ...
1
vote
3answers
65 views

Replacing undefined variables

Here's a MWE of what I want to do: a = 1; If[ValueQ[#], #, "Null"] & /@ {a, b, c} (*Actual: {Null, Null, Null}*) (*Expected: {1, Null, Null}*) What am I not ...
3
votes
0answers
123 views

How to ScanThread and ScanIndexed?

Why are there MapThread and MapIndexed but no analogous functions for Scan? What is the ...