# Questions tagged [list-manipulation]

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

9,397 questions
Filter by
Sorted by
Tagged with
1 vote
61 views

### Creating coefficient matrix

Suppose I have 3 elements, $\{A1,A2,A3\}$. I have 3 independent polynomials, stored in a list $\{A1-s*A2,A2,A2+A3\}$. I want to create a matrix form which will help to visualize easily which elements ...
• 301
149 views

### Why is the code with multiple Do slower than the one without them, and why is For faster than Do?

For some table tab having N rows and n columns, I need to go over all its rows $j$ and ...
• 4,642
45 views

### How to flatten a list in NMaximize?

I have the following function: ...
• 1
118 views

### FindPeaks in a 2d list and half values

FindPeaks is a nice little help. But it only works on 1D lists and tends to return half integer values for positions of the peaks which are ultimately very useless ...
• 3,733
154 views

### Numerical integration of a list

I have a list, p, obtained by a complex numerical procedure. Its element has the structure: {k,fi,z}. Below I give a simplified ...
• 38.7k
401 views

### Add the number of occurrences to the list elements

I'm not explaining it well, sorry. There is a list[j] consisting of randomly selected number {a,b} elements. For example,({j,4}) ...
• 294
101 views

### Why is the following code not compilable?

The code below should replace particular elements of some table acccolumns if some condition is satisfied: ...
• 4,642
60 views

### Why does the following code not change the table?

Consider the following code: ...
• 4,642
158 views

• 6,754
354 views

### Efficient way for writing -1 <= X[i,j] <=1

I have an $m \times n$ variable $X$. I want to write the following constraint ...
• 247
90 views

### Constructing Toeplitz Matrix

How can I construct this matrix?
• 53
204 views

### How can I remove and keep the elements of this set?

I have a list list = {{1, 3, 7, 1, 2, 1, 4, 7}, {6, 2, 7, 9, 4, 3, 6, 7}, {2, 8, 8, 2, 3, 2, 4, 6}, {5, 7, 7, 5, 2, 1, 2, 4}, {8, 10, 10, 8, 2, 1, 2, 4}} Consider ...
74 views

### Error with using ReplaceAll

I wrote a For Loop. In this For Loop, I want to change the values of a list. The main issue is: I have a nested list like: ...
• 2,615
210 views

### Build a region from an unsorted set of points (Imported from a .DXF file)

Please consider trying to download the following .dxf files : DXF File - HEA DXF File - UNP DXF File - RRW Context : Every file contains a drawing of a particular type of steel profile used in civil ...
1 vote
39 views

### Evaluate integrals on imported data and export the results

I have imported an excel file Data=Import["data.xlsx"] which gives the output like this: ...
• 379
211 views

### Find shortest subsequence

We will deal with arrays of chars, but not strings! Let we have the next three arrays: ...
• 1,197
473 views

### How to set to 0 all terms in a matrix which contain a minus

For a matrix like F = {{β , x β}, {-2 β, -3 β}}; F // MatrixForm I would like to set to 0 all terms which contain a minus, in this case the bottom row, getting <...
• 1,592
305 views

### How to plot properly the following data?

Consider the following test data: ...
• 4,642
1 vote
125 views

### How could the whole series of graphics be saved?

I would like to save a series of graphics of a function as pictures. But the problem is that I can't manipulate the name of the graphs, because of that only the last graphics in the series is saved. ...
• 1,753
88 views

### PositionIndex of isomorphic value

The following example is a simplified version of a problem I am working on: equivalent[x_, y_] := Mod[x, 7] == Mod[y, 7] Given a list, say {3, 7, 5} and an integer ...
• 1,596
2k views

### Find Roman numerals up to 100 that do not contain “I"

The question is from Elementary Introduction to the Wolfram Language, section 28 Tests and Conditionals: Find Roman numerals up to 100 that do not contain “I”. What am I doing wrong that the following ...
• 481
1 vote
127 views

### How to get DFT from Sound/Audio/Image?

When I'm trying to do Discrete Fourier Transform or just get a ListPlot of values from Sound object, I get error message.. I understand that Fourier command (and ListPlot of course) works only with ...
1 vote
105 views

### How to sort eigenvalues (from minimum to maximum) and their corresponding eigenvectors?

When using NDEigensystem, the first eigenvalue corresponds to the first eigenvector, the second eigenvalue to the second eigenvectors, and so on. I would like to sort the eigenvalues from min to max, ...
• 1,753
92 views

### Multiplying a certain column from a table with a function

I have the following list of matrices whose second entry I would like to multiply/divide with a function, say f, and store the resulting table as a new table. How should I go about doing that? Thanks *...
• 31
1 vote
75 views

### Separate the elements of a row [closed]

I have a $\psi$: {a,b,c,d,e,...} for example for 10 letters. How can I change it in the format: {{a},{b},{c},{d},{e},...} I ...
• 1,503
1 vote
149 views

### How to combine Flatten and Partition? [closed]

In order to get list x4 from list x1, I used three operations. How to get list x4 in one ...
• 1,753
1 vote
99 views

### List manipulation and plotting

I have a code which takes as input RandomSample[Range[d^2],4] for a given d and outputs a value ...
• 414
241 views

### How to join two one dimension lists as columns in a matrix [duplicate]

I would like to take a one dimensional list, e.g., list1={1,2,3} and add a second column, e.g., list2={a,b,c} to get ...
• 131
148 views

### Plotting two variables from multiple lists

Given a few lists as below ...
• 293