Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
2answers
216 views

Using a table to format a grid

Ok, I can't wrap my head around this because I don't know Mathematica well enough yet, so I'm asking for help, at least a direction to explore in. I have a Grid: ...
0
votes
2answers
112 views

Drawing a large set of Graphics3D cylinders provided a set of cylinder specifications in a list

I'd like to draw a large number of 3D cylinders using Graphics3D. My list specifying the cylinders has elements that look like the following: ...
8
votes
3answers
244 views

finding anagrams

What I'm trying to find are the 4 letter words in the mathematica dictionary that have the most anagrams and the amount of anagrams these have each. But I can't seem to find all the 4 letter words in ...
-1
votes
1answer
59 views

map rational number [duplicate]

I am trying to map this function ((-1)^(1/Denominator[#]))^Numerator[#]==(-1)^#& to a fairly big list of random rational numbers I am trying to get this to ...
4
votes
1answer
214 views

MapThread Alternatives

I want to add two matrices, the first one containing a 2D vector at each position the other one a list of 2D vectors. The 2D vector from the first matrix should be added to each of the 2D vectors at ...
4
votes
1answer
156 views

MapThread and Compile

After discovering that MapIndexed cannot be used with compile (see MapIndexed and Compile) I am now trying do implement similar functionality using a combination of ...
0
votes
1answer
100 views

Problem with List Dimension Outer Map [duplicate]

I am currently handling a big list which has the following dimension: {6, 3, 4, 2, 2, 1, 8} where the last number 8 represent a ...
2
votes
1answer
114 views

Can Map operations be compiled or otherwise sped up for large lists?

I'm performing a series of Map operations in the following script: ...
1
vote
2answers
198 views

How to apply function f for each time value t, to each pixel from image, resulting in t images

I have a 2D array of complex values and I want to apply a function to every entry of the array, for every timepoint t in a list. I know how to apply my function to one entry for every time t in a ...
1
vote
1answer
198 views

Map a function conditional on elements at multiple relative positions in a list

I figure this question has many solutions, and if an answer already exists it would be nice just to be referred to it. I need a function that 'maps' over my list and produces a list of equal length ...
3
votes
1answer
329 views

Using Thread or MapThread over multi-level, ragged lists [duplicate]

This may be a rather strange question. I will try to create a sort of minimal working example. Suppose that I have two lists, list1 and ...
9
votes
6answers
303 views

Using MapIndexed only at certain elements of a list

MapIndexed is a very handy built-in function. Suppose that I have the following list, called list: ...
8
votes
5answers
362 views

Span a function across several consecutive elements in a list

Suppose that I have a list called list. I would like to span an arbitrary function f across specified consecutive elements in ...
0
votes
0answers
113 views

Strange ParallelMap behavior

Let the symbol V denote an element of some vector space and nV its norm. Let lin be a linear ...
6
votes
3answers
797 views

Mapping a pure function with multiple slots [duplicate]

Here is a pure function with multiple slots: (#1^2 + #2^2)&[3, 4] 25 But how can I map that pure function over lists of values? For example, say I want ...
7
votes
2answers
318 views

Using Map with If

I have an If statement I need to carry out where the result should be a single number for each time the if is executed. What I have at the moment returns a list for each time the If is executed. I ...
3
votes
3answers
112 views

Applying a function of several arguments to the rows of a matrix

I have a user-defined function which takes three vectors as input. Suppose that is like this: f[a_, b_, u_] := Total[a*Total[u]^b] Usually I have vectors for ...
6
votes
2answers
210 views

Variable scoping problem when mapping over delayed replacement

This is something that got me curious while I was playing around with Mathematica. Consider the following (contrived) example: ...
5
votes
1answer
138 views

How can I substitute something using only map?

For example, I have the equation x^2 + y^2 == x*y and I want to apply the rule y -> s*x I can do it easily by ...
3
votes
4answers
305 views

another way to do this mapping of a two argument function

Sorry, I'm just starting to learn mathematica. I have the following two-argument function: h[{x_, y_}] := x ^ y When I do the following: ...
5
votes
1answer
425 views

nested use of Apply/Map/MapThread in pure functions

1. My main question I have a function with two argument slots. I wan't to apply this function to 2 lists with different length's. I thought in this solution: ...
1
vote
2answers
79 views

How to construct a new list made from a function that operates on two lists

I need to take two lists (each list contains the number of moles of a chemical). I have a function calledFraction that takes the each entry of the list and then calculates the mole fraction of ...
1
vote
3answers
123 views

Placeholders for map inside a map

I have a list structured like list1 = {{"header1","header2","header3"}, {0,1,2}}; and I'm using a custom function to find the number of the column with a ...
3
votes
3answers
176 views

Dynamic application of several polynomials

I know how to get the 'resulting image' (y) from the application of a certain function (f) (here represented as the coefficients of a polynomial) over a certain interval (x): ...
3
votes
1answer
185 views

Issue with ListConvolve

I am a new Mathematica user, learning the intricacies of functional programming. I have issues withe applying a function over a moving list. My function seems to work and give correct results but it ...
2
votes
2answers
155 views

Using DeleteCases and Map together

Given: list1 = {{"a",1},{"b",2},{"c",3}} I would like to delete any pair in list1 that does not have a first element that belongs to list2. Example 1: If ...
2
votes
2answers
358 views

Efficiently compute double sum

Is there a "Mathematica Way", like Map or Apply to compute the following double sum? $\sum_{i=1}^{N_1}\sum_{j=1}^{N_2} m_i n_j \, f(\tau_{i} \gamma_{j})$ I have already stored the lists ...
6
votes
2answers
547 views

Nested Map and Apply

There are some other questions on this topic but I could not get an answer from reading them. What I want to do is use Apply on some of the arguments of a function, ...
6
votes
2answers
394 views

Map a function over the columns of an M x N array

I have a $N \times M$ list of lists, or rather, a list of records and I want to map a function over its columns (e.g. find the mean temperature, age, etc.). Map ...
11
votes
4answers
383 views

What's fastest way of defining 10^5 down values?

I want to define isGood[___] = False; isGood[#] = True & /@ list where list is a list of several million integers. ...
3
votes
3answers
3k views

Map w/ multiple arguments [duplicate]

Possible Duplicate: How do I use Map for a function with two arguments? If I have a function: F[x_,y_,z_]:=x*y*z and I want to call it with several ...
28
votes
12answers
1k views

Map a function across a list conditionally

It seems that this is a really basic question, and I feel that the answer should be obvious to me. However, I am not seeing. Can you please help me? Thanks. Suppose I have a list of data ...
7
votes
3answers
531 views

how to efficiently apply function to all pairs of a set (and collect the results)

To build a graph, I need to apply a function f[a_, b_] to all pairs of a list (3500 elements). The function itself returns a link ...
1
vote
2answers
196 views

Expectation over a list with nested-mapped expressions

I need expected values of a list where the random variable to take expectations over should be an input into expressions defined earlier. I suspect Set[] and SetDelayed[] tripped me. (Or Map and ...