70 views

### Indicate level with Replace [duplicate]

Replace[{{x^2, Sqrt[x]}, {x + 1, x - 3}}, f_[x__] -> f, 1] Level 1 of Replace works here as expected with output {List,List} ...
3k views

### Levels: how do they work?

I cannot understand how Mathematica manages levels, and so it's always a painful try-and-fail to use Flatten. Can someone please give me a very clear definition? ...
69k views

### Assign the results from a Solve to variable(s)

I understand Mathematica can't assign the results of a Solve to the unknowns because there may be more than 1 solution. How can I assign the 4 values of following result to variables? ...
5k views

### Scan vs. Map vs. Apply

I cannot understand the difference between Apply, Scan, and Map. I have tried to play with ...
524 views

### ReplaceRepeated seemingly omits some rules

Is there a simple way in Mathematica to prevent rule reordering? Let me give an example: ...
482 views

### Determine if a variable appears in an expression or not?

Consider an arbitrary expression expr. This expression may contain arbitrary data, like integers, variables, implicit functions etc. Now, I would like to determine ...
213 views

### Prevent testing Head with ReplaceAll

I have a list of strings list. I am trying to get rid of some elements that match string pattern patt: ...
484 views

### Accumulate second elements in sublist

I want to accumulate the second elements in each sublist identified by its first element. ...
221 views

### Replace For with If in Mathematica way

I have this code: ...
751 views

### Use map on a different level

I have just started to get used to Mathematica's Map, Apply, and related functions, and I can't figure out how to do maps that require working "one level down". For example, I am currently trying to ...
266 views

### Variable partitioning of the data in the form of “list of lists”

I am looking for a way for variable partitioning of the data in the form of a "list of lists" for interpolating the imported data from excel. The data looks like: ...
330 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 list,...
842 views

### Collect and simplify both the coefficents and the matched patterns

(This is a far tighter version of a previous question I asked) The problem with Collect is that while Collect[exp, pattern, Simplify] will simplify the coefficients,...
Look at these two examples: In[1]:=Select[f[i], MatchQ[_f]] Out[1]:=f[] In[2]:=Cases[f[i],_f] Out[2]:={} It seems that the Select take $f[i]$ as List, but Cases ...