# Tagged Questions

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

95 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 ...
109 views

### Delete duplicates from a list of pairs with a SameTest [duplicate]

I have a list of pairs, for example like this: list = {{1, 1.1}, {1.00001, 1.1000001}, {2, 1}} I would like to delete a pair which is lies within a certain ...
95 views

### Eliminating elements from sublists under a global condition

Consider the following list of 4215 sublists (note that the file as displayed at github is truncated, but there is a link to the full version). Each of the ...
57 views

### A question about the ArrayResample

I have a confusion with the function of ArrayResample.This is a illustrative picture in Details and Options about the method of "Bin": Then I make a example like this: ...
52 views

### Function for generically controlling 'Manipulate' parameters

I want to use a generic function to generate controls in manipulate, which looks like this: ...
78 views

### Calculating products of given length of two matrices

I have the following problem to solve. Let us have two given square matrices $A$ and $B$ of the same size and a positive integer $n$. I would like to produce all products of length at most $n$ of ...
109 views

### How to asign the points below a line to a specific value?

I have a list {{x1,y1},{x2,y2}...}. I want to create a list {{x1,z1,0},{x2,z2,0}...} with $z1<y1, z2<y2\cdots$, so that I ...
78 views

### Who can explain the strange behavior of command “Last”

Situation I use Last to extract the last element of an expression. Let poly=a+b*c+Log[a]+z. Problem When Using ...
91 views

### Map with multiple arguments

I have a function f[m,n] and a list of arguments args = {{m1,n1},{m2,n2},{m3,n3},{m4,n4}, ...} that I want to apply to it. I ...
136 views

### Finding position of non empty matrix entries

I have a series of circles in space and I am trying to find the intersections of a given line and the circles and storing that in an array using Table. As the line ...
161 views

### Finding pairs where the intersection of them is empty set from a nested list

It would be better to give an example first. Suppose I have a nested list of the form list = {{ 1,2,3,6}, { 3,6,10,20}, { 4,7,11}, { 10,20}}; where each element ...
86 views

### Converting path list to the nested list

I'm trying to convert the plain path list to the nested tree list like the following codes. ...
261 views

### Trying to Figure Out how to work with datasets & Classify[] and Predict[]

I'm new to Mathematica and I'm a bit overwhelmed. I have always used R for my statistics problems. Now that I'm trying to replicate what I do in R in Mathematica I'm making little progress. For ...
110 views

I would like to do the following: ...
160 views

### Programming for matrix manipulation

I want to write a programme which operates on nd x nd matrices. The programme looks the matrix as a n x n block matrix where ...
113 views

### The conflated two uses of SameTest within Intersection

Intersection works as expected in this case... a = Range[1,5];b=Range[3,7]; Intersection[a,b] giving... {3,4,5} However if ...
92 views

### How can I create a set (list) provide a kind of rule/algorithm?

Example: S = {r ∈ Q : r² < 2} Let S be the set of all rational numbers whose squares are less than 2. It follows that 1 ∈ S, 4/3 ∈ S, but 3/2 doesn't ∈ S because 9/4 ≥ 2. Thank you.
106 views

### Use Style on list elements

I have a list like this: list = {0, 0, 0, 1, 1, 1} I want to color all the 0's in red, but I dont want to count through all the elements, like in my solutions, ...
226 views

### Intersection does not take list of lists

The function Intersection takes a number of lists (sets) and finds their intersection. However, the precise input is ...
201 views

### How to partition a list according to a nested table structure?

This question is related to this quesion. The goal is to use ParallelMap to map a function to a nested Table to get the ...
179 views

### Using list elements in TrackedSymbols for Dynamic

During the execution of the following code a column of three lists and two sliders are displaying in output. The first list updates if either a or b changes. The second list updates only if the value ...
125 views

### Non-canonical re-ordering of nested lists

I have some data in the form: ...
616 views

### Find local maximum in 3D list

I have a set of data of the kind {{$x_i$, $y_i$, $z_i$}, ...} at randomly chosen points $x_i, y_i$. The $z_i$ are supposed to be a smooth function of the $x_i$ and $y_i$. Unfortunately they turn out ...
162 views

### Rearranging a set of numbers

I have this set of numbers, that is a range of prices (ie 6-10) and a quantity of products (5) ...
143 views

### Creating a list from other lists and varying the number of elements that get added

Suppose I have listA = {M, F} and ListB = {a,b,c} I want to make a new ...
231 views

### Function[] argument nesting for operations like Select[]

The following code selects a special element from a list thelist = {"this", "notthis"}; Select[thelist, (# == "this") &] What I want is a function which ...
100 views

I cannot find the original post now, but I'm quite sure that there's an amazing post teaching us how to do Thread on ragged lists. but my problem is how to inverse ...
93 views

### remove unevaluated cells from table

I have created a table Tv where each row is of the form {x, y, Iv[x,y]} where Iv is some complicated numerical integral and <...
75 views

### Implementing the Cimmino method [closed]

What am I doing wrong? I am trying to implement the Cimmino method, an iterative method for the solution of linear algebraic systems. The final output should be a vector. Here is a description of the ...
126 views

### Plotting a table with many y values

I'm trying to plot a bifurcation map for a Lorenz System. I have a function (called estables in the code that follows) which, for a certain value r, returns the ...
140 views

### Find the length of the intersection of two lists including duplicates

I have 2 Lists. The first one includes all the numbers from 1 to 10. listA={1,2,3,4,5,6,7,8,9,10} The second includes ...
70 views

### Calling results of applying f to expr inside NestList

Being new to Mathematica, I try to follow the suggestions of using NestList, Map, Table ...
70 views

### Calculate Cumulative Mean and Standard Deviation of a list without FOR loops [duplicate]

I have a simple list mylist={x_1,x_2,...,x_N};. Now I want to map a function over this list, e.g. the Mean and StandardDeviation functions, so that it will give me ...
102 views

### How to gather a list whitout no repeat element to nearest a certain number

Background: The question derive from this question.But some criteria is omited by me.So I try to post a new question for this.If my expression is dimness and you have got it,just tell me or edit my ...
42 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 ...
92 views

### How do I convert Subscript[{4, 5, 1}, 7] to the integer 4*1 + 5*7 + 1*7^2 = 88?

I am working with the finite fields package in Mathematica 9. If I input: GF[7, {-2, 0, 0, 1}][{3, 4, 1}]^2 Mathematica gives me $\{4,5,1\}_7$. I want to ...
85 views

### Solving a list of equation which takes so much time

I try to solve a list of equation in a following way but it Mathematica solves equations after 30-40 minutes or don't solve them at all. The functions that I use are ; ...
203 views

### Tracing 2d coordinates by using Nearest function

In 5 digital images I have determined the 2d coordinates of detected objects. The resulting coordinate list can be downloaded from here: http://pastebin.com/7bE0CEJ5 ...
118 views

### How can I make custom accumulated sequences like the following?

First of all, I don't really know how to formulate the question, so if you understand my question and know a better way to phrase it, please revise. I have the following Matrixes: ...
63 views

### How do you add one chart to the right of another? [closed]

I have two charts, and I would like to insert the data from one at the end of the other. However, the one chart has multiple ListLinePlots, and when I use Show to try and place the two together, the ...
198 views

### Animating N points

So I'm trying to create an animation of N interacting particles in two dimensions confined in a box. Generating the data is fine and it's being stored in a text file with two columns for each particle;...
60 views

### How does levelspec work inside Position?

Please, can you explain the following feature of levelspec inside Position ? This code test=Range[5]; Position[test,x_/;x>2] as expected, gives ...
130 views

### Programming a MaxMin Linear Optimization

I want to program a function for a two-player game. Basically it's like this: . Each player has an array of options, and the result of the game is based on both players choices. So heres my most ...
44 views

### Simplifying nested KroneckerProducts

Any suggestion how to bring a nested KroneckerProduct form into just one? I mean some how converting ...
86 views

### (Again) eliminate curly brackets from PopupMenu?

How can I display the items in a PopupMenu , which is fed by a list, without the curly brackets? The sample code is: ...
663 views

### Use a part specification as the argument to a compiled function

I have some code that needs to generate a large matrix based on some complicated combinations of smaller matrix elements. I find that if I write a function for the element of the larger matrix, and ...
100 views

### Count two or more equal consecutive elements in a list and create histogram

I have a list generated by: list = RandomInteger[{1}, 100] it contains only 0's and 1's ...
97 views

### Retaining relative sizes of local maxima using MaxDetect[List]

I would like to be able to find the position of the two greatest local maxima in a list. For the example: list={1,2,3,4,2,1,2,6,5,4,3,2,} I would like to return <...
### Combining $n$ lists [closed]
From this question, I know how to combine two lists. In fact, if $X_1,X_2, X_3$ are lists with the same length, then the command Transpose[X_1,X_2,X_3] will work in ...