We’re rewarding the question askers & reputations are being recalculated! Read more.

# Questions tagged [list-manipulation]

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

5,818 questions
Filter by
Sorted by
Tagged with
65 views

### Triangular matrices with conditions

I would like to generate a lower triangular matrix that has checkmarks in the non-zero entries. The way that I created this matrix is the following ...
95 views

### Implement gradient method in functional programming style

I implemented the gm for quadratic function in Mathematica, but it looks like more in an OOP style, as the pic shows. How to rewrite it in Mathematica style? I tried with following code: ...
68 views

### Problem with Inserting in a Nested list

So I have a nested list like this: {{{0}},{{0}},{{0}}} Now i need to Insert in the first sublist like this ...
50 views

### Generating And / Or Conditions Automatically from a List

I have the following list: l1 = {x y, s t, a b} From this list, I am trying to essentially generate a new list that looks like this: ...
49 views

### How to obtain the minimal index n in a list (A) so that Total[A[[1;;n]]] is bigger than a specific value m?

Imagine the A array is {1,2,3,4,5,1,2} and m = 4. Then in this case, Total[A[[1;;3]]] is 6, ...
29 views

### Differentiation of a series with unknown coefficients

I have a function $f(x)$ expressed as $$f(x) = \sum_{k=1}^n {a_k}sin(kx)$$ and its derivative with respect to $x$ is then $$f'(x) = \sum_{k=1}^n k{a_k}cos(kx)$$ I am actually new to Mathematica and ...
261 views

### Removing Shorter Subsets in List of Lists

I have in Mathematica a list of lists like this: ...
72 views

### How to return the equal points between two lists

I have something like this ...
55 views

### Map list of functions over list of inputs

Given a list of functions {f1, f2, f3, ...} and list of inputs {1, 2, 3, ...} I wish to produce the list ...
43 views

### How to efficiently select positions of elements in a sublist

Apologies if this is an already answered question, I was unable to find anything until now. I believe the answer will be quite simple, I have just been stuck on it for a few days now. I have a large ...
57 views

### Element-wise minimum of two matrices

I am trying to compare two identically-shaped matrices and select the minimum of the two. This is an extension of a past question: Element-wise max of two lists, except I have three nested lists. <...
36 views

### Part Assignment of variables with argument

I do not really understand why this: a = {1, 2, 3}; a[] = 3; a {3,2,3} works as desired, but this does not: ...
38 views

### Importing a 3 dimensional list

I have a code that is generating some numerical data in the form of a list of trajectories. Each trajectory itself is a list of 2D coordinates. Each coord. is a list of 2 numbers.(see example data ...
79 views

### Create a list of the first 100 deficient numbers

For the purposes of the assignment, I need these values in a table. We have so far only used for/while loops to check the deficiency or abundance of certain types of numbers. I initially tried using a ...
34 views

### Transpose two lists with rightarrow and commas [closed]

I need to transpose the two following lists: data0 = {99.52267, 93.78726, 99.67644, 99.85036}; error0 = {0.21152, 0.37626, 0.16309, 0.10167}; Into ...
38 views

### Interpolating and subtracting two sets of data

I have a data set "data9k" with x varying from 0 to 365, and another data "data0" set with x varying from 0 to 365. But the x values for both data sets are not same but similar. I want to subtract the ...
55 views

### How can a set of rules be applied to edit strings within a list of lists while maintaining list structure?

In attempting to read a webpage ("https://www.house.gov/representatives#by-name") I have managed to import a table using ...
43 views

### How to Mathematica applied discrete Fourier transform to matrix?

I am new user of Mathematica, sorry if my question odd. I not understanding, how to Mathematica apply the discrete Fourier transform for matrix: ...
84 views

### Why is lisa[i_, j_] :> Nothing un-evaluated?

Anyone know how to correct it with minor change? Input...
209 views

### How to select pairs in a list of pairs where the second pair element is within a specified range? [closed]

I have a list like the following list of pairs: ...
32 views

### Removing all sublists containing any arbitrary string as one or more of its list component

so, basically I have a list of sublists of varying length. For example, ...
31 views

### assigning integers to inner lists

Consider a asymmetric list which has been obtained from a NSolve command ...
25 views

### Deleting numbers from a list based on another longer list [closed]

I would like to delete all elements of a list that are equalled to any element found in a bigger list. For example, if I had A = {1,2,3,4,5} and B = {2,4,6,8,9,12} I would like to get C = {1,3,5} ...
855 views

### Flatten an array

I have obtained an array of results as follows ...
36 views

### Sets of k expressions, being k a variable

I need to write something like Table[Subscript[A,i] = i, {i,5}] in order to define a set of expressions. All is OK with this, but if I try to left the number of expressions as a variable k... Table[...
1k views

### Make a list of Fibonacci numbers less than 1000, whose index is in the form 3m+1. Verify that all these numbers are odd

I've been working on this for far too long with unsatisfactory results. And after losing all my hours of work around 4am thanks to a glitch in the program itself, I'm at my wit's end. It was ...
45 views

### How does the Fourier transform take its input?

I'm using the Fourier command and I'm wondering how does it take its imput. I know that it takes a list of numbers representing a function of time and it gives back a list of numbers representing a ...
104 views

### How to transform an UpperDiagonalMatrix into a symmetric matrix in Mathematica 5.2?

I have an UpperDiagonalMatrix as the following, how to transform it into a symmetric matrix in Mathematica 5.2? Note: don't use the command ...
43 views

### Remove elements from a list with a mask

Suppose we have a list {a, b, c} and a mask {1, 0, 1} (or {True, False, True}). And we want ...
1k views

### I wanna get a result of i/j . Like 1/3, 1/5, 1/7, 3/5, 3, 5/3… Something like that. But none of my code works [closed]

None of this works,can anyone correct this? 1st method j = {1, 3, 5, 7, 9}; i = {1, 3, 5, 7, 9}; jase[i_, j_] := i/j 2nd method ...
29 views

27 views

### Easiest way to simultaneously keep track of two values in a list

I have a bunch of functions a,b,c,... that all take in a list of images and return a list consisting of a list of transformed images, and a number (let's call it ...
30 views

### Why is my code for density using Folner Sequences giving incorrect values? [duplicate]

I am creating a code that calculates or approximates $$D(S\cap[a,b])=\lim_{n\to\infty}\frac{\left|S\cap{F_n\cap[a,b]}\right|}{\left|F_n\cap[a,b]\right|}$$ where $D$ is the density of $S\cap[a,b]$ (...
64 views

### How to pass pair of parameters in function

I am writing a function with a pair of values {x,y}, I have issues when I apply this function to list such as...