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

learn more… | top users | synonyms (5)

3
votes
2answers
120 views
3
votes
1answer
159 views

Union of two or more lists

I have a number of lists (only 3 shown here) ...
3
votes
1answer
128 views

Constructing lists in an efficient way

I have a list of functions and I want to separate them into two lists: a list that contains the functions that have at least one zero and a list that contains the functions that do not have ...
3
votes
1answer
139 views

Creating an autokey cipher function

Can someone help me with putting what I can say in words into code. I want to create autokey encrypt and decrypt functions (just wanting help encrypting and then can figure out decrypting). Everything ...
3
votes
4answers
117 views
3
votes
1answer
203 views

Making a list of rules from 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: ...
3
votes
1answer
99 views

Part specification error only in LogPlot

I've a problem. I defined a simple list and a function like below: lst := {5, 10, 20} f[m_] := lst[[Floor[m/10]]]; and drew a plot ...
3
votes
2answers
120 views

How to modify the elements of a list in a loop?

I have a list with points coordinates. And I'm trying to traverse it and perform some matrix operations on each point. But I have a problem with storing modified points in the initial list instead of ...
3
votes
3answers
323 views

Data Table Manipulation

Suppose that I have the following ...
3
votes
1answer
130 views

How do I get the length of held list without evaluating the list?

I used Extract with Hold to retrieve a sublist containing expressions I didn't want evaluating, e.g. ...
3
votes
1answer
117 views

Recursion when randomizing elements in a list

I want to randomize certain elements of a list; Since the code list = {a, b, c, d, e, f, g}; list[[{1, 3, 5}]] = RandomSample@list[[{1, 3, 5}]]; list works fine, ...
3
votes
2answers
400 views

How to delete all rows in datafile that contain a string

I'm importing some data from a file. However, the file was created by an unreliable instrument, such that the data looks like this: ...
3
votes
1answer
1k views

Plotting multiple lists of complex numbers

The user #Nasser showed an elegant way to plot complex numbers: ...
3
votes
1answer
193 views

Levels and slots

I am struggling with levels and #, if I understand this I think I will be able to grasp the entire concept. ...
3
votes
2answers
112 views

Linear interpolation of a list between periodic anchorpoints

I have a list of the form: list = {1,1,1,2,2,2,3,3,3,4,4,4,7,7,7,19,19,19}; Where we can see that there are an ordered set of integer values that repeat ...
3
votes
1answer
140 views
3
votes
1answer
138 views

Filtering the elements of an array to split them into two categories

So, I am new to Mathematica, and I am trying to write something that involves taking values from one array and separating them into two different arrays. My code for doing this is: ...
3
votes
1answer
474 views

Replace elements in a list

Suppose that I have a list: ...
3
votes
2answers
97 views

How to generate a list from an iterator and some arbitrary function

Suppose I'd like to generate a table of integers: Table[i, {i, 10}] Great; now suppose I want only the integers that are even ...
3
votes
1answer
511 views

Operations on a List of Vectors (Norm)

I have a List containing vectors. The coordinates are random numbers: r = {RandomReal[{-1, 1}, n], RandomReal[{-1, 1}, n], RandomReal[{-1, 1}, n]}; Now I want to ...
3
votes
1answer
182 views

Minimize sum of array elements subject to conditions

I have array where each point at different times are shown parameters ...
3
votes
1answer
46 views

Corresponding list value and index in a list

I have a list and I know the maximum value of that list by using Max[list]. The thing is I want to find out the index number of this list that corresponds to 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
1answer
64 views

How to collect elements in one list with the constraints provided in a second list

I wish to collect the items in the first list provided the constraints in the second list. For example in the lists shown below the first list shows a bunch of strings and the second list shows the ...
3
votes
1answer
67 views

sorting eigenvectors of a final combined matrix

I have two matrices m1 and m2 as below: ...
3
votes
1answer
56 views

Remove cases where region specified incorrrectly

I am using MeshPrimitives to get a list of 3D components of a Mesh Region. Within that list, I normally get some incorrectly specified regions, such as ...
3
votes
1answer
99 views

Partitioning Table

I have a long vector array in the following format: ...
3
votes
1answer
124 views

Map an Argument to a list of functions

I want to "map" an argument to a list of functions. Here is the concrete Problem. I generate a list "Messungfit" of functions: ...
3
votes
3answers
206 views

Delete rows based on specific periods

I have data (.xlsx format): two columns - data in first column imported as DateObject (dates with specific time), data in second column are numbers (113388.28, 865165.98 etc.). I want to delete the ...
3
votes
2answers
100 views

Replacing members of a list with elements sampled without replacement from another list

I have a list of element pairs: pairList = {{1,2}, {2, 3}, {3, 4}, {4, 5}}; I'd list to pick a subset of the elements in this list: ...
3
votes
3answers
83 views

Generating increasingly longer lists from a single list

I start with an array such as {{1,1},{0,1},{-1,1}}. (1) I want to create an array from this which replaces each array inside the array with 3 new arrays, one ...
3
votes
1answer
90 views

Remove values from list element, and add to other element

Basically what I need is to make a list of 400 elements, all have value 1. The next step is to create a function, that subtracts value (-1) from an element, and adds that to another element. So: ...
3
votes
1answer
137 views

Read and write files

I have a text file, its content is(for example): ...
3
votes
2answers
124 views

Find Lists with intersecting sublists

I have a list of the following form: ...
3
votes
1answer
65 views

Grouping Nested Lists Based on Differing Values of Single Element

I've a list of lists representing k-rows of truth table having n elements each in a nested list consider ...
3
votes
1answer
6k views

Finding the position in a list where the maximum or minimum value occurs [duplicate]

We can use Max[exampleList] or Min[exampleList] to find the maxima and minima of ...
3
votes
1answer
676 views

Exporting/Importing a Table of complex numbers

I'm generating a long table of list of the form: PN={{1,2,1+i},{3.5,2.6,2}...},{...},... Using: Export["PN.dat", PN, "Table"] ...
3
votes
2answers
879 views

Dynamically remove element from list based on test

Suppose I have a list l = {a, b, c, d, e, f....} I would like to remove one of each pair {x,y} if some function ...
3
votes
5answers
84 views

Insert or Remove randomly

I have a series of characters such as "ABCVABVCCAVB". I wish to randomly remove or insert character. I could make to remove case like deleting all A, or B,... but I wish to remove or insert only 1 ...
3
votes
1answer
92 views

Extreme Slowdown with Fold

I am doing a finite difference model, and need to create a list recursively. For a small list, Fold is extremely fast, but when the list becomes large enough, Fold becomes extremely slow. Here is the ...
3
votes
1answer
67 views

How to multiply a row to multiple rows in a matrix

I have the Following Matrixes; ...
3
votes
1answer
34 views

Difficulty with LevelSpec. Product of empty set should be 1

I have a matrix newm = {{{}, {}, {-p}}, {{d}, {e}, {p}}, {{g}, {h}, {i}}}; MatrixForm[newm}; whose elements are lists. I would like to multiply the elements of ...
3
votes
1answer
52 views

Saving Dot-ed eigenvectors in a special comparison

We have produced a 4*4 matrix in any iteration containing nx from 0 to 2 by steps of 0.5. and in any iteration we have saved sorted orthogonalized-eigenvectors based on their eigenvalues with this ...
3
votes
1answer
68 views

Iteration variable in variable [duplicate]

Is it possible to create following list by some sort of iteration? {a1,a2,a3,...,a100} I cannot think of any way to append a to ...
3
votes
2answers
95 views

SameTest issue?

Folks, I am trying to construct and algorithm which finds all of the remaining groupings (of three items, in this case) from a list of items for which no two items are in groups that have previously ...
3
votes
2answers
291 views

Modify all the second elements of every pair in a list of pairs

I have a list in the form {{a, 1}, {b, 2}, {c, 3}}. Let's say I want to operate a transformation on all the second elements of each sublist, but this transformation is a function of them all ...
3
votes
1answer
223 views

Indexing of Large Autonomous System of Equations for Use in NDSolve

I currently have a list of ~150 autonomous ODE's that I need to be able to work with using NDSolve. Fortunately I already have them formatted in plaintext, which ...
3
votes
1answer
340 views

Efficiently finding the maximum value of a column in a matrix

Imagine I have a matrix of the following form: TestArray = $((a_1,b_1,...),(a_2,b_2,...),(a_3,b_3,...),...)$, where a specific example might be: TestArray = ...
3
votes
0answers
74 views

Kernel crashes when computing finite difference mixed derivative with respect to y & z but works fine when computing with respect to x & y or x & z?

I am using Mathematica 10.4.0 on Ubuntu 16.04. I am trying to solve a set of differential equations using finite difference method on an NxNxN cubic grid (x, y, z directions). I am getting a weird ...
3
votes
0answers
56 views

Searching a deeply nested list [closed]

I have a deep nested ragged list. ...