# Tagged Questions

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

53 views

### Color a list of 2D points continuously

I have a list of 3-tuples. First 2 positions are coordinates in $R^2$, the third specifies concentration of a chemical at that point, which I want to render in color. Here's what the list looks like: ...
110 views

### Strange Manipulate behavior

Running the following code and pressing the play button under b will input -2147483648 in b. ...
83 views

### Interpolating initial conditions of orbits

I have a data file containing the $(x,y,p_x,p_y)$ initial conditions of two-dimensional orbits. Let's plot them on the $(x,y)$ plane. ...
74 views

### Predicting the initial conditions of orbits inside a closed curve

I have a data file containing the four orbital element $(x,y,p_x,p_y)$ of a two-dimensional closed loop orbit. Note that the exact implicit equation of the orbit is not known. The plot of the 2D ...
53 views

### Passing each element of a list as an argument to a single parameter function [closed]

Consider a single parameter function: g[w_] := w^2 +1; Consider a list: slist= Range[0, 100, 1]; Now when I apply function ...
220 views

### How to select elements from a list of pairs based on 2nd element of the pair [closed]

I have a large list of arrays of the following form ...
70 views

### Using select in a nested list [closed]

I have a nested list of the following form ...
137 views

...
32 views

### Arrange of several files

I am struggling to import my data. There are 400 files in CSV format with names organised by date like: Table1_20111003_YYYY_MM_DD_0000.dat. In each file over 20 colums and 86400 rows (seconds of ...
206 views

### Transforming a list of the form {{{x, y}, z}, … } into the form {{x, y, z}, … } [duplicate]

This should be a fairly simple question, but I can't figure out how to do it. I have a list of points of the following form: ...
56 views

### Not able to apply Scan in place of For loop [closed]

I have been advised to avoid procedural loops and use other functions like Scan,NestList, FoldList, NestWhileList, Inner and Outer. My worry is that if I have a need in which certain critical ...
1k views

### Riffle but not quite

Given the two lists below, is there an in-built command or otherwise neat way of accomplishing the desired output. ...
83 views

### Creating sublists [duplicate]

I got this example in Mathematica references. v = ToExpression["a" <> ToString[#]] & /@ Range[1,44] Could someone explain to me the function of the ...
60 views

### Create a table indexed form a list giving a the index specifications

I need to create a table indexed form a list. e.g.: list={{i, 3}, {j, 4}}; would give the table Table[..., {i,3}, {j,4}]; ...
116 views

...
54 views

### Putting the elements of a list inside another list [closed]

I have the list list1 = {1, 3, 4, 5, 6} and want to put the elements of this list inside a list of 0's, ...
108 views

### Changing the order of elements in a list

I have a list of the form list1 = {1, 3, 4, 2, 5, 6} and I would like to replace each of the elements in the position of represented by the previous number in the ...
55 views

### Convolution with modified indices

I want to perform convolution for a sequence but instead of having the indices cycle from the ends periodically, I want to apply a function, specifically Abs, to ...
164 views

### Selecting points inside a closed curve

Let's create a rather dense grid of initial conditions ...
30 views

### Splitting a list into sublists with different sizes [duplicate]

I have the list {7, 8, 9, 10, 11, 12, 13, 14} and would like to split it into a list of size 2, a list of size 3, and covert the remaining element into singleton ...
46 views

### Mapping AssociationThread over list with repeating keys [closed]

I have two lists. One with the same repeating four keys and the other with unique values. Both are the same length. I want to Associate the first list with the second list. So if that if the 5th ...
197 views

### Selection of points based on position

I have a series of points, for example: points = {{0, 0}, {1, 3}, {2.5, 2.5}, {4, 4}, {6, 6}}; I want to join all points successively unless, for example, the y-...
162 views

In the following example Nearest finds the nearest values between list1 and list2 and ...
95 views

### Group matrix values by column [closed]

Original Question: I have a list {{a, 1}, {b, 3}, {c, 1}, {d, 2}, {e, 3}}. I want to be able to group the the first number in each pair that has the same second ...
125 views

### Calculating density of states from lists of momentum/energy data

I am trying to calculate the density of states for a 2D system given certain band structure data organized in a specific format. Below is an example of my procedure: Beginning with a simple 2 x 2 ...
40 views

### ListPlot[Transpose[{xx,yy}]] returns blank plot [duplicate]

This is complete mystery for me, but I am unable to plot the following data... I have two lists, that I want to ListPlot. The data is created in the following way (I edited the code for more clarity): ...
158 views

### Operation with lists

I have created this code and was wondering if you could suggest a less convoluted way of solving the problem. I have two lists: ...
246 views

### How to double elements of a list given by their positions

Given that I have a list $\{P_0,P_1,P_2,\cdots,P_7\}$, where, $P_i$ is a real number or a list like {x,y}/{x,y,z}. Now I would like to double some elements ...
83 views

### Mapping a simple 2 variable function

Quick Question: What is the best way to map this function so it performs seperately for 102 different values of x? ...
88 views

### best fitting crossing divides region plots with different background colors

We have two lists: ...
102 views

### Hovering over specific coordinates on a picture

I'm working on a small function which can be used so that when the user hovers over certain coordinates in a LocatorPane, these coordinates can be checked against a separate list of coordinates, and ...
195 views

### Finding the most common n-tuples of a list of lists where order does not matter

I am still learning to use Mathematica and I need some help. How could I get the most common pair, and generally the most common n-tuple of a list (row vector) given a list of lists of ...
35 views

### How to create a function similar to MorphologicalComponents?

As everyone knows, MorphologicalComponents can create a list that shows only the difference between morphological clusters. But sometimes we need to find out the ...
71 views

### How to import multiple .m files at once?

For example, I import several files with the following lines: ...
69 views

### Keeping determine digits in Append to process

The end of my code is written as below. Ignoring the inefficient role of Append, I want to have very simple set of values as for example: ...
614 views

### Are there more readable and terse method can get this list

I have a list like following list = {{1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}}; I want get this list by a more better method: I ...
159 views

### Filling between two listplots

I have two lists which are plotted by below simple command ...
64 views

### Combining the entries of two lists [closed]

I have two lists {a, b, c, d, e} and {1, 2, 3, 4, 5}. I want to creat a new list of tuples as follows ...
70 views

### Counting the rows of a list where the order of numbers in the row doesn't matter

I am trying to make a computation with a large set of rows. As a sample, suppose I have a list of numbers with rows and columns like such: ...
62 views

### Need help with making an interactive 3D plot

My main problem is to generate a manipulatable 3D plot, combining three functions and two of those functions depend on another variable Theta (which shall be the manipulateable variable). To explain ...
55 views

### How to generate a random matrix and its average value is a specified value

I want to generate a random matrix whose average value is a specified value,such as 5.5. I found these function here.But I don't know how to use it to do this.I think ...
45 views

### Successive differences of elements in a list with step s apart

I have a list of elements list = {a, b, c, d, e, f, g, h, i, j, k, l, ...} I am trying to get successive differences with step s apart. For example, for $s=3$, I ...
235 views

### Solve and design “water flow”

In some strategy game I play, I'll have to change the terrain to make the water flow in some specific way to fulfill my goal. The water flow changes with terrain so if I can change the terrain wisely ...
82 views

### Updating a nested list using elements from another nested list of the same shape

I am new to Mathematica. A quick question: Given a = {{1,0,0,2},{2,0,1,0}} aR = {{1,0,1,0},{0,1,0,1}} if element in a is ...
246 views

### Unexpected behavior of Sequence — using Sequence to delete parts of an expression

I thought that assigning Sequence[] to the part of an expression was an effective way to remove it. For example, the following code yields {2,3,4,5}: ...
31 views

### Using DatePlus with a list of dates and list of times to add

I have a list of dates such as t2 = {"2016-06-08 05:00:00", "2016-06-08 05:00:00", "2016-06-08 05:00:01"} and a list of offsets (in seconds), such as ...
186 views

### Delete all strings that are prefixes of another string

I have a long list of strings and I'm trying to find a more efficient way of removing those elements that are prefixes of another: ...
47 views

### Showing the numbers greater than 0 in a list [duplicate]

I have an operation that outputs the list ...