# Tagged Questions

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

58 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 ...
84 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 ...
182 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. ...
124 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: ...
25 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 ...
97 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 ...
58 views

### Adding another looping element with a list

I have code that is looping on to elements and is working shown below ...
274 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 ...
68 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 ...
288 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, ...
119 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: ...
38 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: ...
150 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 ...
149 views

### Select using MemberQ

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

### Company headquarters for each cell in a spreadsheet

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 ...
614 views

### How to smooth the noise

This is a sample data ...
32 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 ...
66 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 "{" ...
394 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 ...
119 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 ...
82 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 ...
62 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 ...
97 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 ...
95 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. ...
213 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 ...
81 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 ...
97 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 ...
53 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 ...
110 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 ...
119 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 ...
154 views

...
271 views

### Efficiently test membership for a list of values

I have two lists: excluded and values. I would like to efficiently determine whether ...
249 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 ...
79 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 ...
88 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 ...
111 views

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

Say I have 2 lists ...
146 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 ...
77 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 ...
83 views

### Setting up a system of equations for solution

There are two lists as follows: ...
729 views

### Count the sequences in an array

Is there a short and easier way to count number of sequences in a list? Let's say I have three lists: list1 = {0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0} ...
42 views

### Join data imported in different variables [closed]

I've imported data from Excel into several variables and I would like to join all data in one "big" variable. I seem to have a problem when one variable contains numerical data... ...
88 views

### Ask about the variable and constants in partial derivative in a loop

EDITED I have a function in a list like : func={2(x^2)+x*y+3(y^2)}; I want to have a UI that ask me which parameter (x or y) is a variable in a ...
45 views

### Transpose four lists of data into two lists for use in List Plot [closed]

I have four lists of data x1 = {1,3,5,7} y1 = {0,2,4,6} x2 = {10,12,14,16} y2 = {8,10,12,14} In one line is it possible to use transpose to get two lists which ...
146 views

### How to get multiplication of the elements of a specific list/Matrix

Assume there is a list: List1={a,b,c,d}; Then I want to get these calculation: ...
42 views

### How to get Complement function working in a For loop? [closed]

I've been working on a piece of code that will delete small components from a nested uneven matrix (n pages, n rows, 3 columns), by deleting the pages with less than ~30 rows. However, I've notice ...
126 views

### Initializing several values of a function

How do I initialize several values of a function at once? Consider the function f[0] := 1; f[1] := 2; f[2] := 3; f[n_] := f[n] = f[n-1] + f[n-2] + f[n-3]; Is ...
172 views

### Given a matrix of integer, create a matrix with 1 or 0 according to which numbers are in the first matrix

Not sure the title gives the idea of what I need, so here is a sample: I have ten (w) combinations (subsets) of 20 (n) numbers taken 4 (k) at time. I need a matrix of dimension w x n with 0/1 in each ...