# Tagged Questions

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

107 views

### Delete Element within a List based on the Order [closed]

I want to do the following, deleting the element of a list that do not match an increasing order as example: {1,2,3,4,6,5,7,8}->{1,2,3,4,6,7,8} I've thought of using DeleteCases but I'm not able to ...
179 views

### Do not expand matrices in Mathematica calculation

Here is an example of a problem I'm having. Consider that I have defined: omega={{p[t]},{q[t]},{r[t]}} x={{a},{b},{c}} R={{1,2,3},{4,5,6},{7,8,d}} What I would ...
539 views

### For loop in Length computation code

Here is a code I wrote that is supposed to give the length of list after some splitting and regrouping. But it is inefficient. Is there a way to rewrite in more professional and efficient way? I guess ...
60 views

### Dynamic insertion of variables

I have a list of eigenvectors of a given matrix. I need to programmatically modify this list by multiplying each vector by a variable #i, e.g. ...
66 views

### Changing the precision of data in a list of matrices

I have a list of matrices ...
443 views

### List manipulation challenge

It's necessary to get from list = {{a1, b1, c1}, {a2, b2, c2}, {a3, b3, c3},{a4, b4, c4}, {a5, b5, c5}}; I'd like to do this with ...
87 views

### Is there a way to create a table where the number of dimensions is parameterized?

I'm imagining the likes of this: ...
72 views

### Module using for creating a table [closed]

I want to have a 4 tables with using of module. Unfortunately I don't know why doesn't it work ...
91 views

### List of list to list of rules

I have a list of this type p = {{y, 1, 3}, {x, 2, 0}, {z, 3, 1/(k + 1)}} I can use a Do loop that is ...
318 views

### Converting a Table to a Dataset

I feel like this is a simple task, and there may be a built in method to doing this (but I can't find it if there is). I would like to be able to take a table and convert it into a structured Dataset. ...
125 views

### Difficulties with list manipulation

I have a list of five elements. For example, list1 = {a1, a2, a3, a4, a5}; I'm trying to get a list: ...
30 views

### Specifying plot markers (filled diamonds or squares) [duplicate]

I can plot my list data and I can use of specifying circle to show my plot-markers. I used of Mr.Wizard comments on that page. But I don't know how can I fill the circles of those plot-markers with ...
106 views

### Applying a function to a list with fixed intervals and fill the resulting list [closed]

I want to apply a function f to a list with fixed intervals, and then fill the gaps of the resulting list, as shown in the following picture. Since it will be run ...
61 views

### Adding another looping element with a list

I have code that is looping on to elements and is working shown below ...
672 views

### Use a part specification as the argument to a compiled function

I have some code that needs to generate a large matrix based on some complicated combinations of smaller matrix elements. I find that if I write a function for the element of the larger matrix, and ...
72 views

### How to solve an equation given certain parameters?

I am new to Mathematica so please bear with me. I have an equation that has around 7 parameters and one unknown. I was able to use FindRoot to solve it; however, I ...
379 views

### how to concatenate a list of a list of strings

I have two lists of lists, La and Lb that I want to concatenate so that every element of a list n in La is concatenated with the corresponding element of list n in Lb. For example: La = {{P, O, O, O}...
150 views

### Why is there a difference when formulating patterns for Select and FirstPosition?

Select[{1, 2, 4, 7, 6, 2}, # > 2 &] Gives {4, 7, 6}. OK! So one should think that the following would work: ...
43 views

### Basic Question: Split Nested list into respective elements [closed]

New to Mathematica, just have a very basic question to ask. I have a table of results like so: ...
169 views

### Given a list of triangle vertices, how to find the neighbors for each vertex?

A triangle is represented by {a,b,c}, indicting that its vertex IDs are a, b, and ...
170 views

### Select using MemberQ

I want to make a selection on this list ...
82 views

I have an Excel spreadsheet column with hundreds of company names on it. I need to find the address (or just city if that's easier) The operation for this is simple in wolfram alpha. i.e. typing "...
810 views

### How to smooth the noise

This is a sample data ...
34 views

### Creating a custom list [closed]

This is the first list lts1 = Table[i, {i, -1.8, 5.8, 0.1}] 1st question: In the interval between -1.8 and 5,8 how can I choose the step beforehand so as the ...
72 views

### An extra { when importing a file [closed]

I am trying to import data from a file. {k0,{a0,b0,c0},{e0,f0,g0}} {k1,{a1,b1,c1},{e1,f1,g1}} MyList = Import[file, "Data"]; But I get a list with an extra "{" ...
584 views

### Find all the possible ways of partitioning a list into a set of pairs of element

I have a list {x1,...,xN} where N is even, and I need to find all the possible ways to split it into pairs of elements, e.g. the ...
132 views

### How to select a submatrix containing similar elements from a matrix? [closed]

( This question is related but does not ( fully ) answer my questions. - Finding the position of similar elements in a matrix ) I have not written code yet, I am in the design phase of code for the ...
84 views

### Output matrix with common elements

Given lists of lists like a and b, I want to obtain an output like c. a = {{2, 1, 0}, {1, 2, 1}}; b = {{2, 2, 0}, { 2, 2, 1}}; c = {{2, 0, 0}, {0, 2, 1}} If ...
66 views

### Applying corresponding elements of a list to a list of functions

I found this post which applying a function to a list of functions and arguments. I thought I could change my code with a table to something more elegant. I am not wedded to the ...
114 views

### Confusing “Part::pspec” and “Part::partw” following call to ParametricPlot3D

The problem I'm having is that the function definition given below continually gives me baffling error messages. I'm trying to turn a list of 3D points into a function that approximates a curve by ...
108 views

### Using and replacing sequential elements of a list

Very simple question but I am an absolute beginner, so apologies if this has already been answered. I need to pick sequential elements of a list, excluding t=1 and t=T, and use them in a function. ...
286 views

### On a strange pattern of triangular numbers in Ulam's spiral

In this MSE post, user GeMir noticed that, where the green dots are the triangular numbers, $$T_n = \frac{n(n+1)}{2} = 1,3,6,10,15,21,28,36,45,55,66,78,91,105,120,136,\dots$$ in the Ulam spiral ...
102 views

### Count two or more equal consecutive elements in a list and create histogram

I have a list generated by: list = RandomInteger[{1}, 100] it contains only 0's and 1's ...
101 views

### GatherBy output with given Shape

I would like to group items in a binary list according to some property like in the following simple example. ...
48 views

### Apply ListPlot to various data sets [duplicate]

Assume that I have data in the form: list = {{{1, 2, 3}, {10, 10, 10}}, {{4, 5, 6}, {20, 20, 20}}} I want to plot ...
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 ...
173 views

### Combining data sets by adding y values [duplicate]

Suppose I have the following list of data {{1,2},{1,5},{6,1},{1,3},{2,1},{2,2},{2,3},{5,4},{5,2}} This is similar to my actual data in that each x value has ...
131 views

### Positions of elements in a list [duplicate]

I have two lists: list = {1, 2, 3, 4, 5} slist = {3, 5} I want to find the positions of the elements in slist in list. I tried it like this and I dont understand ...
97 views

### Union sorting after ignoring some digits

I have a list with its bellow elements: {-0.7071067811865476, -0.7071067811865475, 0.7071067811865475, 0.7071067811865476} If I use ...
171 views

...
273 views

### Efficiently test membership for a list of values

I have two lists: excluded and values. I would like to efficiently determine whether excluded...
269 views

### What is the idiomatic way to shift and extend a list by a number of elements?

I have a lists, list, and want shift it right by a given number of elements, m, extending the list by repeating the last element....
90 views

### How to delete blank valued keys from nested association?

Considering we have: acs = <|"A" -> <|"a" -> " ", "aa" -> "asd"|>, "B" -> <|"bb" -> " "|>|> How can we come to have a result ...
97 views

### Retaining relative sizes of local maxima using MaxDetect[List]

I would like to be able to find the position of the two greatest local maxima in a list. For the example: list={1,2,3,4,2,1,2,6,5,4,3,2,} I would like to return <...
121 views

### Using MapThread over 2 lists different length with criterion on minimal differences

Say I have 2 lists ...
265 views

### Replace values in a list based on conditions

I have a list with negative and positive numbers list = {-1, -2, 1, 2} and I want to replace all negative values with 0 and all positive values with 1 ...
82 views

### How do I define a random variable involving Part?

I need to define a random variable that involves Part, but when I try, for example ...
87 views

### Setting up a system of equations for solution

There are two lists as follows: ...