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

learn more… | top users | synonyms (5)

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
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
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 ...
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 ...
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
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: ...
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 ...
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. ...
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
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 &]] ...
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 ...
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 ...
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 ...
7
votes
8answers
390 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
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
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
58 views
3
votes
1answer
90 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
800 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
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 ...
2
votes
3answers
142 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
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
247 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
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 ...
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
38 views
3
votes
1answer
62 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
38 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
56 views

Searching a deeply nested list [closed]

I have a deep nested ragged list. ...
11
votes
1answer
98 views

Speed up Dynamic for graphical interface

I am trying to create a user interface where I can click on certain points in a set of data and save them into a list that can be used later in my code. The problem is it is currently sluggish. Is ...
9
votes
5answers
201 views

Transpose two uneven lists [duplicate]

I am trying to plot two lists using the ListPlot command. I need to merge two lists. The two lists I have are: ...
3
votes
2answers
81 views

Problem with Custom Sort/Split/Gather

Please help me Sort/Split/Gather/Group(by) a set of symbolic expressions! (extreme TL;DR at bottom) I have a set of symbols (which represent 2-vectors in a plane, ultimately) and I want to ...
4
votes
1answer
107 views

Trim a list of elements [closed]

I suppose this is a trivial question to many of you, please bear with me. I have a long list of words, list1. I would like to "remove all words that contain a specific letter, say "o". ...
9
votes
4answers
243 views

How to convert a sparse matrix to a list of sparse arrays?

I have a matrix stored as a SparseArray. How can I convert it to a List of its rows, where each row is stored as a ...
4
votes
2answers
198 views

Replacing numbers of which you only know certain digits

If I have a list of numbers like this: list = {0.3565127, 0.8656421, 0.231479879, 0.39698787, 0.536987651}, which are all between 0 and 1, each having lots of ...
7
votes
2answers
114 views

Deleting certain elements from a nested list

I have a nested list of the form {{{{a, 0},{b, 1},{c, 2}}, {{d, 4},{e, 5},{f, 6}}} ... } where the $...$ just means it goes on like that. On the innermost level, ...
3
votes
2answers
91 views

Get position in list of the first element with a certain property

Consider a toy list l = {x[2],x[32],x[43],x[56],x[72]}; I would like to find the position of the first element within this list, for which ...
1
vote
2answers
72 views

Is it possible to draw a line on a MatrixPlot that would reflect density of row values? [closed]

I have a MatrixPlot with some data and I'd like to draw a vertical lines representing the "average" (density) of that data for each row. Something like this for ...
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 ...