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

learn more… | top users | synonyms (5)

6
votes
4answers
191 views

Group list elements in sequence

Suppose we have the following list: list1={1,2,4,6,8,9,10,14,15,17,21,22,72,76,80,96,106,116,117} Actually the real list has about 100K elements. What I want to ...
3
votes
3answers
114 views

Assigning to multiple variables in a list the values in another list

I have two lists, one contains the variables and the other the corresponding values that the variables should take. ...
1
vote
3answers
130 views
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
66 views

Adding +2015 to each value of my x-axis [closed]

I want to change all of the values of my x-axis by +2015 The problem is, I evaluated a large expression using incremental values {i,1,85} and plotted that data. The Plot's x-axis is 1 to 85, as ...
0
votes
0answers
64 views
1
vote
1answer
59 views

Generating lists of data with ReplacePart

I have the following example: ...
2
votes
0answers
71 views

Function output

I would like a function that computes Cartesian product of two sets z=(Tuples@{#1,#2}), and computes the number of elements in this set(list) ...
3
votes
1answer
152 views

How can I optimize the search between two lists, one that is changing length?

I'm trying to identify unique arrays by comparing two lists, one which is growing in length. The number of elements in the list grows as 2^n^2, where ...
5
votes
3answers
129 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 ...
0
votes
3answers
85 views

Interactive Application using Manipulate for Fibonacci Series

I am working on creating interactive app using Manipulate function on fibonacci series using SeriesCoefficient. I want to plot the fibonacci numbers based on the slider of Manipulate function. I ...
2
votes
1answer
60 views

Pairing values with their indexes for MapThread

Several operations require you to map over a list of values and to know the index of each value as you process it. To accomplish this, my current somewhat ugly solution uses MapThread: ...
4
votes
1answer
62 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
1answer
45 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 ...
1
vote
2answers
59 views

How to use Cases to extract sublists [closed]

I have the following values obtained from a table: ...
4
votes
2answers
300 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 ...
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 ...
6
votes
1answer
115 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: ...
1
vote
1answer
63 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 ...
4
votes
3answers
129 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. ...
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 ...
0
votes
4answers
101 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 &]] ...
11
votes
3answers
324 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 ...
8
votes
4answers
852 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
267 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
78 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
56 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 ...
4
votes
2answers
193 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 ...
7
votes
8answers
393 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
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
188 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
149 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
1answer
59 views
3
votes
1answer
92 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 ...
21
votes
3answers
804 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 ...
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 ...
16
votes
16answers
2k views

Generating a list of numbers that are not multiples of 4

I want to write simple code that will list all numbers from $1$ to $n$ that are not multiples of $4$. And in this case I consider that ...
1
vote
2answers
57 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 ...
2
votes
3answers
143 views

Compile error with MapThread

I have the following code: ...
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
49 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
255 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 ...
15
votes
4answers
515 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 ...
0
votes
1answer
51 views

Number of points of a polygon [closed]

Hi I have the following polygon: a = {{{-105.5, 842.}, {-105.5, 496.464}, {1.4375, 519.379}, {28.5, 528.271}, {28.5, 655.25}, {3.6, 842.}}} I want to count ...
1
vote
1answer
41 views
3
votes
1answer
65 views

How can I get the arguments of the function Graph?

If I have f0 = f[x,y,z] and I am interested in the list of the arguments, what I do is ...
3
votes
2answers
39 views

Setting initial conditions of a domain grid?

So I'm writing some code to try and produce a cellular automaton which will model an oscillatory chemical reaction, but I'm trying to set up the initial conditions of the grid so that I can vary them ...
3
votes
0answers
59 views

Searching a deeply nested list [closed]

I have a deep nested ragged list. ...