Questions on the manipulation of List objects in Mathematica, and the functions used for these manipulations.

learn more… | top users | synonyms (5)

1
vote
1answer
47 views

Transform {x,y,…} and {a,b,…} in to {x->a,y->b,..} [closed]

How to merge two list and add -> to it. For instance, I have {x,y,z,...} and {a,b,c,...} ...
1
vote
1answer
58 views
8
votes
3answers
1k views

How can I get a running sum for a list?

I've got following data I'm reading from a file: ...
11
votes
3answers
321 views

Gathering of list

Problem statement The following challenge was recently posted to the J language programming forum by Skip Cave (http://jsoftware.com/pipermail/programming/2016-March/044561.html): "The animal ...
5
votes
3answers
125 views

Lazy form of Tuples/Outer to loop over list of lists

This is less a question and more asking if someone has implemented this already, with more skill. I need to perform the Outer-like generalized outer product of a ...
4
votes
1answer
57 views

How to create overlapped block matrices and simplify the result

This is sort of a duplicate of Creating overlapped block matrices, but the question wasn't fully answered since the OP never returned to clarify. I am using Kuba's answer for FEM, but I have been ...
1
vote
2answers
56 views

How to use Cases to extract sublists [closed]

I have the following values obtained from a table: ...
4
votes
2answers
296 views

How can I define variables that follow a naming pattern?

Let's say I have this enormous list of a million elements, and I want to access this list piecemeal in non-intersecting sublists of length ten. If ...
1
vote
1answer
43 views

DOS-like Wildcard for Filtering List of Files [duplicate]

I have a list of file names that I would wild like to filter based on a DOS like wildcard specification similar to what can be used as the first argument,"forms", of ...
6
votes
1answer
114 views

How to Collect a variable multiplied by a constant?

I'd like to use Collect to get terms that have a variable multiplied by a constant. For example I'd like: ...
6
votes
3answers
948 views

How to plot several functions without jumping? (multiple eigenvalues of a system as functions of 2 parameters)

I've been working on this research problem for months with some success by no global/proper solution to the problem. So I have square, Hermitian matrices of various sizes ($8,20,38$ dimensions) with ...
0
votes
1answer
104 views

Delete only when there are two (or more) 1s

I would like to remove element from a nested list when they have a certain number of elements repeated. For example: {{1,2,3,4},{1,1,2,3},{1,3,4,1},{1,4,2,4}} I ...
4
votes
3answers
128 views

Indexing all elements of permutations $S_n$

I have this Table that gives all elements of $S_n$, I would like to know how to improve efficiency. ...
1
vote
3answers
240 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 ...
7
votes
8answers
389 views

Coefficient list of an expression with indices

My apologies if this question has been asked before, but for the first 50 or so questions on coefficientlist, I couldn't find a similar topic. If I've an expression which involves a variable with ...
1
vote
1answer
62 views

Create large system of inequalities by substituting coefficients from intervals

I have given statements for example: $ax + by < c_1$ $cx + by + dz < c_2$ And I want to create larger system of inequations in such a way (suppose variables $x,y,z$ from intervals): I ...
0
votes
4answers
100 views

How to use Select according to a list of criteria to produce a list of subsets of another list obeying those criteria

The code Print[Select[{1, 4, 3, 9}, Mod[#, 3] == 0 &]]; Print[Select[{1, 4, 3, 9}, Mod[#, 3] == 1 &]]; Print[Select[{1, 4, 3, 9}, Mod[#, 3] == 2 &]] ...
4
votes
2answers
192 views

In a list, exclude words that use too many specific letters

Trying to re-rwite for clarity. Referring to my previous lists: I would like to trim a dictionary so that all words that "consume" more than n letters "x" are ...
0
votes
0answers
48 views

Selecting items in a list based on multiple conditions Part 2 [duplicate]

This question has been solved. Thanks for all your help! I encounter another problem, which is related to a previous question. Now, I have data for different days, so that my data now looks like ...
8
votes
4answers
850 views

Tuples with one “joker” digit?

I'd like to create an array of all possible length 11 combinations of 1, 2, and the number 3, BUT with the number 3 only appearing zero or once in each combination. I tried: ...
9
votes
3answers
261 views

Selecting items in a list based on multiple conditions

This question has been solved. Thanks for all your help! I have data that looks like this. ...
3
votes
1answer
77 views

Table with power law indexing

I am using the Drubin numerical inversion out of Laplace space, and need to see how the function performs over a wide range of values, covering multiple logrithmic cycles. However, the inversion is ...
3
votes
2answers
55 views

Numbering indices / array element positions while creating an array (using 3 argument form)

I am new to Mathematica and trying to create a list that I can use within the InterpolatingPolynomial function. e.g. ...
0
votes
0answers
40 views

how to program a dynamic set of numbers

I'm new to the Wolfram Mathematica language. I want to program a dynamic set of numbers in such as: $S={\frac{1+n}{a}=\frac{1}{a};\;\frac{2}{a};\;\frac{3}{a};\; \dots ;\;\frac{1+n_{max}}{a}}$, where ...
2
votes
1answer
76 views

how to manipulate indices in a table/vector

Perhaps I'm missing something very basic. Could somebody guide me how to manipulate indices of a list. For example, if I have ...
7
votes
1answer
143 views

MovingAverage - not enough memory exception

I'm running into an extremely bizarre issue that evades reproduction by means other, than repeating my actions verbatim. Please note, this question is NOT about digitizing a plot. It just describes ...
5
votes
4answers
282 views

Assign values to variable names in lists [duplicate]

I hope somebody can help me in this (I guess) simple question: I have a list of variable names ls={w0,w1,w2} and another list of values ...
1
vote
1answer
57 views

Separation of output [duplicate]

I have solved two equations with two unknowns and confined my answer in just ten answers. The unknowns are n and k, and I want ...
4
votes
4answers
184 views

Changing square brackets to curly brackets in list

I have been trying to change a list of 2D coordinates with square brackets to curly brackets so I can plot the set of points in Mathematica. However, it does not plot because it puts quotation marks ...
1
vote
4answers
148 views

For loop over a list for pairwise distance implementation in Mathematica

I am new to Mathematica and want to implement the following functionality in Mathematica. Suppose I have the following list data4 = {{1, 2}, {2, 3}, {1, 3}}; I ...
2
votes
3answers
141 views
21
votes
3answers
798 views

Typoglycemia text manipulation

I was just reading the article: https://en.wikipedia.org/wiki/Typoglycemia "... readers can understand the meaning of words in a sentence even when the interior letters of each word are scrambled ...
15
votes
3answers
519 views

Solving the magic backyard puzzle with MMA

I was trying to solve this puzzle using mma It looks like the generalization of the magic square. Anyway here my attempt:- There are four columns $(x,y,z,w)$ and nine rowa which are denoted by the ...
3
votes
1answer
89 views

Manipulating the elements of a list

Let's create some sample data tab = Table[{i, j, k}, {i, -3, 3}, {j, -3, 3}, {k, -3, 3}]; ICs = Flatten[tab, 2]; Nt = Length[ICs]; A $3\times3$ system of ...
3
votes
1answer
93 views

Map works but Thread doesn't

This question may be trivial, but I can't get past it for the life of me. I have $n$ matrices of dimension $p_i \times N_i$, with $i$ indexing the $n$-set. I also have $n$ vectors of the appropriate ...
22
votes
7answers
2k views

Find continuous sequences 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 ...
6
votes
4answers
477 views

A fast way to compute arrays avoiding If or Which

I found out that if I have to calculate huge arrays with most of the elements being zero( let's say each row has 10000 elements and only 8 are non zero) and the non zero elements' positions being ...
16
votes
4answers
614 views

How to remove duplicates from set of machine precision 2D points?

I have a set of 2D points with machine precision coordinates. I need to remove all duplicates. Performance is important. This is the most obvious fast solution: ...
6
votes
3answers
583 views

Preparing data for making an ErrorListPlot

I often have the following notebook in Mathematica, which I use to make a dataset and associated errors: ...
4
votes
2answers
381 views

Colors associated to parts of a 3D distribution of points

Suppose we have a long list of random points (in Cartesian coordinates) in 3D space. coords := ...; Until now, I was associating colors in a radial way, from the ...
15
votes
4answers
492 views

Reproducing a ranking function that behaves like Excel's RANK

I tried to find a function or expression in Mathematica that produces the same output as the RANK function in Excel (see its description here), but unfortunately I ...
1
vote
2answers
55 views

Creating Association [duplicate]

I have provided a dataset bellow and I would like to store the data as an Association that I can query. Such that e.g. ...
1
vote
1answer
44 views

changing intervals in do loops

I have a main program whose structure has Do loop and changing that to Table form is not easy at this stage. I want to have ...
0
votes
1answer
31 views

Conflict in deleting because of some digits [closed]

I have a list at 3dplot and I want to have a list the second element of which be equal to 0.2 ...
0
votes
1answer
45 views

Mapping StringToDouble over nested lists of strings, still confused about slots

This is a simple question about slots but I still cant see how to do it after searching stackexchange. (I'm importing a large data file as text and to convert to numbers I think it'll be quicker to ...
14
votes
2answers
246 views

`Part` like `Delete`: How to delete list of columns or arbitrarily deeper levels [duplicate]

On trying to write this answer I reached the frustrating realization that I didn't have an efficient way to delete a list of columns or deeper level components in a simple way as ...
4
votes
2answers
222 views

Elegant way to partition list to be faster than `ParallelTable` (using `ParallelSubmit`), or some alternative?

Suppose you have a function fun[x_] := (Pause[.05*x]; x^2); of which you know that its evaluation time increases with its argument - in this case obviously ...