Tagged Questions

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

learn more… | top users | synonyms (3)

1
vote
1answer
25 views

How to form a variable from matrix elements

I have matrix with n rows and 2 columns, say m = {{x11, y12}, {x21, y22}, ..., {xn1, yn2}. Now, I want to form three new variables for example: ...
0
votes
0answers
26 views

Pick out element from array [on hold]

I have the $3\times 3 \times 3$ array: ...
1
vote
2answers
23 views

How to delete certain unwanted elements from an array

Suppose I have an array like so array1 = {{Null,2,3,4,5}, {a,b,c,Null,e}, {w,x,Null,y,z}} Is there some way to selectively remove any element I ...
1
vote
1answer
35 views

Multiway Systems Rules List Management

I'm working with a multiway system and I have a number of different mutation rule lists. I need an efficient way of managing which rule lists I apply. Here is the basic multiway system code that I'm ...
1
vote
2answers
113 views

Symbolic combinations

If I have 3 lists: {a,a},{b,b},{c,c}, then the desired output is ...
1
vote
2answers
33 views

Exporting mixed data of matrices and vectors / lists

thank you for reading my question. I have a problem trying to export mixed data from Mathematica. I have different matrices and vectors, which should be combined to a output file. Here a ...
1
vote
1answer
100 views

Making a list of rules form the list of elements

Starting from the list: {f[q1, q2], f[q3, q4], g[q1], g[q2, q3, q4], d[k1 - q1], d[k2 - q2 - q3 -q4]} I would like to get the result: ...
1
vote
3answers
145 views

Pare down list recursively

What is the best way to pare down a list whereby the $n$th number is removed from the list recursively? This ...
1
vote
0answers
81 views

How to create a complex variable from dated list values

Can anyone help me to construct a variable "PI" from values of variable x. Variable x represents a group of two time series rj and ri on equal dates(joined two dated lists with states).Variable x have ...
5
votes
4answers
199 views

How to extract a part of matrix satisfying certain condition(s)

I have a following matrix ...
2
votes
4answers
64 views

Selecting every n-th element from a list [closed]

I have a list: data = {4, 5, 7, 8, 9, 5, 3, 2, 1, 2, 13, 12}; I want to take those elements in the list which are located at equal distances, say, every third ...
3
votes
2answers
87 views

MapThread problem

I would like to do the following: ...
4
votes
3answers
104 views

Extracting columns from multidimensional list

Perhaps a very easy question but I posted this on the Wolfram Community and didn't get any answer.. Suppose I have data like: ...
1
vote
0answers
48 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 ...
4
votes
2answers
109 views

Can't figure out how to apply these functions repeatedly

I have the following problem, and even though I've tried Fold & Inner, Sow & Reap, et al. I can't figure out the clean way to do this. Here's the problem. I have a list that starts as ...
3
votes
2answers
52 views

Fast functional method for multiplying duplication numbers in a large list

Consider a list of symbols: mySet = {a, b, b, c, a, b, c, d}; I would like to form the product of duplication numbers. In the example above, I have 2 ...
2
votes
3answers
77 views

Manipulating array

I have got an array like this: A = {{{1, 4, 5}, {3, 7, 15}}, {{5, 6, 9}, {7, 8, 2}}, {{9, 10, 1}, {11, 12, 3}}} I make differences in each sublist a following ...
1
vote
2answers
104 views

How to select states with equal times

Can anyone show me how to select the states that have equal times-dates. For example, i have two time series. First that have 10 observations, say from 2014/10/1 to 2014/10/10, and second that have 7 ...
1
vote
2answers
56 views

Replace list of symbols in an expression

I have an expression: exp = a+b+c and a list containing all the symbols of my expression: syms = {a,b,c} and I would like ...
0
votes
4answers
52 views

Conditional combining of nested lists

I have two nested lists like those {{a,A},{b,B},{c,C}...{z,Z}} {{a,1},{c,2}...{t,12}}. I want to combine them to get a new list that looks like this ...
0
votes
1answer
63 views

Rotate points by 60° in 2D

I wrote this code, to rotate a list of points 60° about the first point in the list in 2D, but Mathemtica says: "Recursion depth of 1024 exceeded."
7
votes
5answers
703 views

Check if two lists are equal in any order

Suppose I have two lists, how can I efficiently check if the two lists are identical up to permutations of the elements? For example I would like the function to output: ...
2
votes
2answers
109 views

Matching a case when one element in a pair is Null

I've got a dataset of laitutdes and longitudes. Unfortunately, some of the dataset was from when a time when lat/longs weren't constantly recorded. So I need to remove the invalid data before working ...
6
votes
2answers
75 views

Mathematical operation on two lists by a “key” [duplicate]

I'm a complete newb here. Just looking for direction. I've got two lists like this... ...
1
vote
1answer
53 views

Summing subsets of array

I have an array farr, size Nx*Nx. I have a function frk that maps index {n,m} to an integer (approximately ...
0
votes
1answer
46 views

Loops for Unit Root Test

I want to compute some unit root tests on a data generating process. I already split the sample in 100 single samples, but how can I do a unit root test on all of them and store the results in another ...
2
votes
3answers
125 views

Concisely returning a position in an array with an index variable [closed]

We have an array and an index in the array: exampleArray = Table[{a, b, "q"}, {a, 1, 10}, {b, 1, 10}]; arrayIndex = {5, 4}; Very simply, we can return the value ...
2
votes
2answers
34 views

replace an interval of values [duplicate]

I want to replace values in an interval [a,b] by 0 in a list of values. Example: {{.5,.2,.49,1,1},{.49,.5,.495,1}} I want to get: ...
3
votes
4answers
104 views

How to Remove Undirected Edges that are the Same [duplicate]

Given: theData = {1 <-> 2, 2 <-> 3, 2 <-> 1} I would like to remove any duplicates where I define a duplicate to be: ...
2
votes
3answers
69 views

How to get an element of a list , which is computed out of substituted variables?

What is the best way to get the element of a list, which is computed out of substituded variables? For example one wants to get the first element of the first row of ...
2
votes
1answer
74 views

DateListPlot with multiple data sets and incongruous timelines?

I am using Mathematica to analyze some sales data for my company. (A copy of the available data is here.) We are trying to analyze the sales trends for each month by item. DateListPlot works well ...
4
votes
3answers
106 views

Changing the x-axis for ListLinePlot with more Lists

I'm fighting with a seemingly very simple problem: I have two lists of data, and want to plot them with ListLinePlot. The two lists are only data-points, therefore ...
9
votes
3answers
224 views

What is the best way to flatten a linked list with lists as values?

By following the advice on this site I have ended up with a linked list like the following: acc = {{1, 2}, {{2, 3}, {{3, 4}, {{4, 5}, {{5, 6}, {}}}}}}; This was ...
4
votes
5answers
209 views

Extracting Coefficients from a List of Sines

I want to extract the coefficients from the following list: list={16.2219 Sin[16.2219 t], 6.60924 Sin[6.60924 t], 13.927 Sin[ 13.927 t], 2.91309 Sin[2.91309 t]} ...
1
vote
1answer
62 views

Transforming a nested list for textual output

Hello I have a data structure based on lists, with items, subitems and subsubitems, and I want to display a textual output with a description. ...
0
votes
2answers
35 views

How do I generate a list of delayed rules? [duplicate]

I want a list like this: {x :> Print[1], x :> Print[2], x :> Print[3], x :> Print[4], x :> Print[5]} I tried: ...
6
votes
2answers
227 views

List of tuples without forbidden pair

How do you get a list of tuples in Mathematica that do not include certain pairs of elements? For example, I'm trying to list sequences of matrices of a certain length, and I do not want two adjacent ...
2
votes
2answers
79 views

Joining two lists with diverse properties [closed]

I want to make a list from two independent ones. ...
1
vote
1answer
66 views

Manipulate filters in arrayplot with graphical user interface

I have a set of images which need to be filtered by different filters. So I have made an interface in which the user can choose his or her filter. However I now want to manipulate the degree of the ...
4
votes
4answers
160 views

Using Cases to get elements in a list

I have the following list: ...
2
votes
1answer
104 views

Sort eigenvectors of a list of matrices

I have a list of matrices and want to obtain a list of eigenvectors and eigenvalues for each matrix, both sorted by the size of the eigenvalue. If I write ...
5
votes
1answer
140 views

Conditional string replacement

I have a list of text and need to replace an element based on the text that appears in the element before it. Example of my list: ...
0
votes
0answers
73 views

Solution of a set of quadratic congruences (Chinese remainder)

Edit: Please remove this question. I think there are mathematics error in what I am asking. You are welcome to edit the question if you can state the problem correctly. I have a set of quadratic ...
5
votes
4answers
173 views

Signed power set of a list

Given {a, b, c, ...} with $n$ elements generate a list with $2^n$ elements. For example, if the list were {a, b, c}, then the ...
1
vote
1answer
69 views

How to Increase Performance of Manipulate Recalculating List?

I have a list in the form of prices below. ...
9
votes
5answers
361 views

Repeating Digits

I have written ...
4
votes
6answers
236 views
4
votes
5answers
141 views

Counting the number of instances where items at the same position in two matrices are equal?

Given two matrices having the same dimensions: m1 = {{1, a, 2}, {4, 5, 0}, {g, a, d}} m2 = {{1, b, 2}, {7, 2, 0}, {a, a, a}} Is there a built-in function that ...
3
votes
1answer
131 views

Manipulating list of matrices

I have a list of around 100 matrices, that looks like this ...
4
votes
4answers
134 views

Sublist pattern matching

Is there any way to simplify the following pattern: {p___, {a___, x_, x_, b___}, q___} :> {p, {a, x, b}, q} Ie. where I remove duplicated elements within ...