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

learn more… | top users | synonyms (3)

3
votes
2answers
18 views

How to re-arrange lists, divide one list into 2 lists with a particular step

How to re-arrange following list: {a1,b1,a2,b2,a3,b3,a4,b4} or this {a1,b1},{a2,b2},{a3,b3},{a4,b4} to get: ...
1
vote
0answers
25 views

Faster trimming of leading/trailing zeroes in rectangular array

Given a (large) rectangular array, e.g. (small for example case): ...
1
vote
1answer
36 views

Collecting specific Lists of data in coordinate form

Note: This might be trivial for many of the users but i am new to mathematica so i don't know!!! Question: Suppose i have three list of data as follows: ...
0
votes
0answers
19 views

ListContourPlot for 3D data [on hold]

I have an n x 3 list of some solar cell data that looks like this. ...
10
votes
4answers
368 views

Finding the period of an array of integers

A simple array of integers is given. The problem is to detect if a pattern is repeatedly occurring in the array, and find the length of that pattern. For example, for ...
1
vote
2answers
46 views

Perform operation on part of a table / create a reference

There is a function f that I would like to operate on a rectangular part of a table t. The part is specified by function ...
0
votes
0answers
20 views

Generating a list consisting of function values like in a triangular matrix

A goal is to generate a SymmetrizedArray of dimension n^k with specified symmetry (let it to be ...
1
vote
4answers
147 views
2
votes
2answers
153 views

Are there any good mass row/column swapping functions for matrices?

I have the following matrix Keeping the 20 row and 20 column fixed (so the 21st rows and columns because I started at 0)...how do I push each row and column back one spot? I need to push the 0th row ...
4
votes
6answers
207 views

Indexed Map Thread

I'm attempting to MapThread a function of two lists that requires the index of the list values. For example, MapThread[#1*i+#2*j&,{{a,b,c},{e,f,g}}] Where #1 ...
2
votes
1answer
52 views

Simplify on a structured array

Why doesn't Simplify and FullSimplify operate on object generated using SymmetrizedArray? ...
0
votes
0answers
28 views

Copying an Imported List to another File

I have a file which begins with a large list of elements created by joining 12 different data imports, which I would now like to copy to another file so that the file can be sent by itself and not ...
1
vote
3answers
118 views

How to do a Check for every element in the list?

I know how to do a Check for the list in general: ...
1
vote
5answers
131 views

How to split list to strings?

Considering a list: lst = {"1", "2", "3", "4", "5", "6"} How can I have two strings : str1 = "1, 2, 3" str2 = "4, 5, 6" ...
0
votes
1answer
25 views

Add elements of one list to sublists of another list [duplicate]

I have the following list of sublists with different lengths {{1,1,1},{2,2},{3,3,3,3}} and a second list {4,5,6}with the same ...
18
votes
3answers
278 views

Bug in MovingMap (breaking change between version 10.1 and 10.0.2)?

The MovingMap window spec has been changed between version 10.1 and 10.0.2. Version 10.0.2 ...
0
votes
0answers
43 views

Loop over elements of list and output to table [on hold]

I have little experience with flow of control in Mathematica and the following task seems daunting to me. I need to evaluate the same set of expressions to all the elements of a list, and then output ...
5
votes
2answers
162 views

Create a list of rules built from data set fields

I want to convert a dataset to a list of features and a list of target values, for use in Predict and also more generally. I know ...
0
votes
1answer
32 views

Strange behaviour of Append [on hold]

I have the following situation and I completely do not understand why the second system can be solved but the first (of the same equations, as it seems) cannot. How is it possible? ...
0
votes
4answers
112 views

Make a program that does union of two lists

I have to make a program that gives as a result the union of two lists using a For loop. I can't figure out how to inspect if the elements of a list are different. ...
2
votes
1answer
54 views

sparse array with list [closed]

i'm trying to populate a sparse array with lists in certain positions, i tried the following code, ...
4
votes
3answers
116 views

How to map over inner keys of nested Associations?

Considering an association: <|"a" -> <|aa-> "asc", bb-> "asd", cc-> 0, ImageType -> "asd", dd-> "asd"|>|> How can I make the inner ...
4
votes
4answers
589 views

Writing a circular matrix

I have two square matrices, $A$ and $B$, of the same size, say, of $m \times m$. What I want is to write a programme/function of three variables, $A$, $B$ and $n$, that outputs the $mn \times mn$ ...
1
vote
2answers
46 views

How can I manipulate this list?

I performed a loop with Table where I solve a system of 4 equations that depends on two parameters: eta and p. I create two lists for each parameter as follows: ...
2
votes
4answers
193 views

How to switch from array to string?

Considering we have an array: a = {2/3, 4/5, 9/7, 3/7, 1/7, 1/9}; How can I get this to be: "2/3 4/5 9/7 3/7 1/7 1/9" ...
9
votes
5answers
357 views

Most efficient way of making pair list from a list

I have a bunch of datasets which looks like: 3 7 1 6 5 8 2 4 1 2 8 1 5 2 5 ... and I need to make a list of pairs such that the first element makes a pair with ...
4
votes
4answers
110 views

Creating a new list from other two lists using for loops

I have two lists 'ups' and 'downs' where they are composed of positions of an element in a matrix and their weight. For example, ...
4
votes
4answers
181 views

How to highlight the elements in a list that match a pattern?

For example, {{1,2,3},{1,2,3,1,2,3,4,5}}with pattern {1,_,3}is transformed to ...
0
votes
3answers
50 views
1
vote
3answers
47 views

Delete permutations of subtables in a table [closed]

I've got a table of tables: $A=\{\{a,b\},\{b,a\},...,\{a,b,c,d,e\},\{e,d,c,a,b\},...\}$. How do I do to remove backward duplicates, or more generally permutations of duplicates in the table? For ...
0
votes
1answer
32 views

Create a Table depending of two variables [closed]

I tried to create a table depending of two variables as: W= Table[{G[[i]], G[[j]]}, {i, 1, 3}, {j, 1, 3}] I wanted it to look like ...
6
votes
3answers
87 views

Comparing elements of a set and deleting elements based on a criterion

I have a function that has two inputs. The first input is a set of 2-element sets, and the second input is a single 2-element set. My function complements each 2-element set with the second ...
0
votes
0answers
39 views

Procedure argument value change [duplicate]

I'm trying to create my own hamiltonian cycle algorithm using Mathematica for school, and I'm stuck on a syntax issue. I get the following error: ...
3
votes
4answers
202 views

How to switch from List of rules to Association?

Considering we have a list of rules: ...
6
votes
0answers
89 views

ListConvolve Memory Hemorrhage

I wrote a routine that convolves an impulse response array with a test array and checks for the RMS difference between that convolution and a data array. I do this iteratively so that I can modify the ...
0
votes
2answers
58 views

Writing a function with variable arguments [duplicate]

I want to write a function which takes multiple arguments varying from 1 to n, where each argument is a triplet. sublistProduct[{$a_1,b_1,c_1$},{$a_2,b_2,c_2$},...] = { $\Pi_{i=1}^{i=n}a_i ...
1
vote
2answers
58 views

How to make function accept list of rules as an argument?

Considering the list of rules: r= {"a" -> "1", "b" -> "2", "c" -> 3, d -> 231, "e" -> 1.25}; I want to have a function ...
2
votes
3answers
99 views

DeleteDuplicates in a list of 2-tuples under condition

Having a list of 2-tuples, I would like to delete such 2-tuples that have 0 at second position, but only those, whose first element is not unique in the list. E.g. ...
1
vote
3answers
97 views

How to manage list of list of rules?

Considering we have a list: str = "{1 -> {a -> aa, b -> bb}, 2 -> {2a -> \"{b -> bb}\"}}" Bringing this to expression gives: ...
4
votes
1answer
64 views

Automatically assign Variablenames to multiple checkboxes

I want to implement the option to import data from Excel and then the ability to trim this data in order to fit the needs. The import from Excel: (source) ...
2
votes
5answers
70 views

Find list item before first negative value [closed]

If I have a list like this: ...
6
votes
4answers
284 views

How to delete Missing[“NotAvailable”] from list of rules?

Considering we have a list of rules: ...
1
vote
1answer
93 views

Accumulating elements of lists taking the criteria out of another list

In order to find the critical values for the significance of a discrete distribution, for example BinomialDistribution[20,0.6], i need a function which works on the ...
1
vote
0answers
35 views

Combine nested list entries [closed]

I have a list with stock index data (which I load from a database) as follows: ...
5
votes
3answers
211 views

Count elements of a list

Let's create a random list n = 100; data = Table[{RandomReal[{0, 2}], RandomReal[{-1, 1}]}, {i, 0, n}] Now we divide the $(x,y)$ plane into four sectors with the ...
1
vote
1answer
109 views

How can i subtract a surface from another

I have one surface which i got with using analytical solution. And one by ListPlot3D. My question is how can be withdrawn from the one from the another. ...
0
votes
1answer
114 views

Manipulating list based on Euclidean distance

I have an array of 101 matrices. Each matrix contains information like id, position (x,y,z), time etc about a collection of particles, looks like this ...
1
vote
1answer
87 views

Summing terms in Table

I have a table that looks like Table[m, {k, 10}, {j, k}, {i, j}] where, m is a square matrix that depends on the indices $i, ...
1
vote
2answers
67 views

Circular Playing up in a Grid

As we know, there is a possibility to emphasize some elements of a Grid by highlighting its cell with ...
8
votes
4answers
717 views

Replacing a for-loop with something functional

I'm a physics grad and have been using Mathematica mostly for data visualization. The evaluation part I normally do with C/Python, but I've been wanting to try out Mathematica for these tasks, too. ...