# Tagged Questions

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

3k 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 ...
469 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 ...
172 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 <...
266 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: ...
172 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 ...
804 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: ...
87 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 ...
170 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 ...
211 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): ...
238 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 ...
228 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 ...
662 views

410 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. ...
7k 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 ...
2k 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 ...