The tag has no wiki summary.

learn more… | top users | synonyms

5
votes
1answer
94 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
49 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
70 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
105 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): ...
0
votes
0answers
53 views

Mapping a function to a Matrix [closed]

I’ve looked up previous answers to this question but haven’t found a suitable answer. I am trying to Map a function that I defined across a Matrix. The function Maps fine across a 1D array but can’t ...
2
votes
1answer
103 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
83 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
191 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 ...
1
vote
2answers
139 views

Thread over a nested list top to bottom until non-list elements are found

I have a nested list: list = {1, 2, {3, 4}, f[a], {2, h[b]}} I would like to apply a function g to all elements of the ...
5
votes
2answers
110 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, ...
0
votes
0answers
70 views

How to map over non-Null values in a list [duplicate]

Possible Duplicate: Selectively Mapping over elements in a List I have a list of distributions and a list of samples. I'm trying to calculate probabilities of some record being within one ...
6
votes
2answers
186 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 ...
5
votes
3answers
117 views

How do I designate arguments in a nested map?

Say I have two lists, list1 = {a, b, c} list2 = {x, y, z} and I want to map a function f over them to produce ...
0
votes
0answers
141 views

Why does Do or Table really slow down this code?

I have some function that usually executes pretty quickly: logf[x_, y_] := N[f[x, y], 40] /. v_ :> (PutAppend[Unevaluated[f[x, y] = v;], "myfile.txt"];); ...
1
vote
0answers
52 views

Evaluation in mapping constructs [closed]

I'm trying to use ReplacePart inside of Map, where the address of the element being replaced is the domain of the map, like this: ...

1 2
15 30 50 per page