Linked Questions
15 questions linked to/from Map a function across a list conditionally
0
votes
1answer
115 views
If statements with a Boolean [duplicate]
If I have a vector {1,2,3}, I want to write an If statement, where if one of the positions is "1", it will perform a certain command.
...
562
votes
19answers
142k views
Where can I find examples of good Mathematica programming practice?
I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
191
votes
3answers
43k views
Alternatives to procedural loops and iterating over lists in Mathematica
While there are some cases where a For loop might be reasonable, it's a general mantra – one I subscribe to myself – that "if you are using a ...
28
votes
9answers
5k views
Find subsequences of consecutive integers inside a list
I have a list which is something like this:
{3,4,5,6,7,10,11,12,15,16,17,19,20,21,22,23,24,42,43,44,45,46}
What I'd like to to is get the intervals which are in ...
30
votes
7answers
2k views
Map-Thread-Through-Apply a list of functions onto a list of (lists of) values
I have a list of functions:
fns = {f, g, h}
and a list of triples:
...
8
votes
10answers
470 views
11
votes
5answers
562 views
Transform a list of functions to a composition
How do I apply a list of functions in a nested way?
Example:
functionList = {f1,f2,f3}
RequiredCommand[functionList,Pi]
such that the required command returns
...
11
votes
4answers
994 views
6
votes
3answers
369 views
ToUpperCases based on the original string
Suppose I have a numberic string
str = "1234567456";
and another string called
nstr = "05eccead24";
I want to transform ...
10
votes
3answers
227 views
Is there a built-in function to map a list of heads to a list of data?
Assume that this built-in function is called func.
What I want is
func[{f,g},{a,b,c}]
will return the following result:
<...
11
votes
2answers
305 views
2
votes
3answers
1k views
How to select elements from a list by condition?
Considering I have a list:
F = {f1, f2, f3, f4}
I want to perform exponent on the list
F = Power[#, 2]& /@ F
Now I ...
16
votes
1answer
480 views
How is the mysterious Raw function used?
I have never seen an example use for the mysterious Raw function:
Raw[h, "hexstring"]
constructs a raw data object with head h, and
with contents ...
5
votes
3answers
252 views
Apply function to list elements only if applicable
Is it possible to apply function to list elements only if function applicable to element?
For example
{1.2, 3, {2.3, 5.4}, null, "fff"}
Floor[%]
gives
...
2
votes
0answers
319 views
Produce {f[x],g[y],h[z]} in as many ways as possible [duplicate]
I have two lists of equal lengths but for my task I will use 3-element lists , namely {x,y,z} and {f,g,h}. The first contains ...