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

learn more… | top users | synonyms (3)

1
vote
1answer
63 views

references in a nested matrix

I have a nested matrix n: ...
6
votes
4answers
214 views

Position of Subsets in a List

I have a particular list of integers and a matrix whose entries are lists. Say I know that my particular list is a subset of at least some of the elements in the matrix. I want to find an efficient ...
1
vote
0answers
73 views

How to sequentially select, from a large set of tuples (of matrices), those with a certain property

I'm interested in finding a computationally efficient way for selecting all tuples of matrices which have a certain property. The property I'm interested in is that I want the column sum, of f[the ...
0
votes
1answer
38 views

How to cut elements from set of data based on function restrictions? [duplicate]

For example, say I have a set of data which takes the form list = {{1,2,4,5,3,2},{2,3,4,2,1,6},{2,3,4,5,4,3}} where all of the elements have a length of 6. ...
1
vote
3answers
113 views

Binning events with weights

I have two vectors, one containing sampled energies and the other one for each of these energies a weight: e(i) and w(i). I ...
2
votes
2answers
175 views

Delete pairs from a list

I have a data set in which I need to remove all matched pairs of entries - not just the first entry that is duplicated but both entries. To add to the complexity, the pairs must be between different ...
5
votes
1answer
221 views

More efficient Omnibus number determination?

Amusing myself with concepts from "Omnibus Sequences, Coupon Collection, and Missing Word Counts", in particular the sequences. To paraphrase the concept, a string is k-Omni over some alphabet a if ...
5
votes
2answers
99 views

Comparison Operation for Nested Matrices

I have a nested matrix n as bellow ...
0
votes
4answers
74 views

Drop row if sum of part of row is equal to zero

My problem is the following: Suppose I have a matrix A which looks the following: ...
5
votes
3answers
229 views

How do I save/export a list so that it can later be easily imported as a list again?

I have a couple of big lists (each of them contains elements that are themselves lists of two elements, i.e. an element of each list that I have is of the form {x, y}) that I want to save/export. ...
4
votes
6answers
394 views

Insert all elements from one matrix into another

I have two matrices $A$ and $B$ which are the same size. Each element of $A$ is a list of numbers. Each element of $B$ is just a number. How do I insert each element of $B$ into the corresponding list ...
0
votes
1answer
47 views

Assign values to variable names in lists

I hope somebody can help me in this (I guess) simple question: I have a list of variable names ls={w0,w1,w2} and another list of values ...
0
votes
2answers
76 views

How do I sum up p items in a sequence?

I have the following sequence list = {p1, p2, p3, p4 ....} I am summing up the p items as follows: p1 + p2 + 2*sqrt (p21*p2) = p12 p12 + p3 + 2*sqrt (p12*p3) = p123 p123 + p4 + 2*sqrt (p123*p4) = ...
0
votes
1answer
64 views

Matrix operations performed with column-vectors

We have 3 matrices: m1, m2 and b. We want to apply matrix operations (dot or sum) in a ...
4
votes
2answers
230 views

How can I create a class of matrices programmatically?

I am trying to figure out how to create a function that can create the matrix pattern below, where: f[1] returns {{1}} ...
0
votes
2answers
81 views

Defining a function as a sum of several Gaussians

I have a function that is a summation of several Gaussians. Working with a 1D Gaussian here, there are 3 variables for each Gaussian: A, ...
2
votes
1answer
131 views

Deleting selected rows from data table [closed]

I'm an intermediate Mathematica user and the select function presented on Data Table Manipulation in Mathematica: Step 2 was very useful in helping me manipulate a 36Mb data file - 13 columns and 180k ...
1
vote
1answer
52 views

Elements of a List according position in axis

({{a, b}, {c, d}}) a, b, c and d are Lists of 300 length. Their first 4 elements must specify their position in the column (1 column, 2 column, etc) and the ...
2
votes
2answers
76 views

Select words from different rows of column headings

I have a 2-dim array. The first 3 rows have column headings. The heading can be a single word, or 2 words (which take 2 rows) or 3 words (which take 3 rows). For each column I know which row has ...
1
vote
1answer
78 views

Nest Replace Function with different rules

I have a table of data that I want to filter. Any value of zero in the table means that value was not calculated, so it should get populated with the tag "NC". Next the table is filtered for all ...
2
votes
2answers
95 views

What is wrong with my use of Flatten? [closed]

Why does Flatten[f[g[a, f[b]], f[c, d]]] result in f[g[a, f[b]], c, d] I expected the answer to be ...
1
vote
1answer
66 views

Is this the expected behaviour from Partition when padding is inserted at the start of the list?

The documentation for Partition shows an example of partitioning without padding, so that no elements are dropped, but the last sublist can be shorter. ...
3
votes
2answers
86 views

Find Lists with intersecting sublists

I have a list of the following form: ...
1
vote
1answer
110 views

Check every list element for appearance

I'm used to MATLAB so this might be a stupid question but Mathematica is freaking me out. I have a big matrix with the following format: ...
0
votes
0answers
32 views

Grabbing columns from a matrix [duplicate]

If I have a matrix - exampleMatrix = {{A1,B1,C1},{A2,B2,C2},{A3,B3,C3}}; And I want to create a matrix like - ...
0
votes
5answers
78 views

Merge two lists for List3DPlot [duplicate]

I have a two lists: list1 = {{x1, y1}, {x2, y2}, {x3, y3}, {x4, y4}, {x5, y5}} and list2 = {z1, z2, z3, z4, z5} and I want to ...
3
votes
3answers
206 views

How can I extract multiple spans from a list?

I know in Mathematica, I can do A = Range[100]; B = A[[50 ;; 60]] B will then contain the 50th through 60th elements of A. Now, what if I wanted B to take 10th ...
2
votes
3answers
180 views

Using Part rather than Extract

In my work I found that I needed the Extract function. However I was wondering if there was a way to use Part. Assume that ...
1
vote
2answers
87 views

Clearing arguments passed to a Module

Is there a possible way to clear the arguments passed to a module to release some memory. I believe that arguments passed to modules are passed by value rather than pass by reference. e.g. I have the ...
4
votes
2answers
130 views

Replacing one element of list

I have a list of sequences of x's and y's. I want to switch the last position to the "opposite" symbol - if ...
10
votes
5answers
425 views

How would you efficiently implement BinListsBy?

Let's say I have a list like this: data = {{21, "Alice"}, {27, "Bob"}, {22, "Charles"}, {34, "Dora"}, {75, "Eliza"}} containing ages and names of persons. What I ...
3
votes
8answers
346 views

How to add a column to a table that counts the number of times the lines appear?

I am at a complete loss at this. I have a table with 2 columns and n lines. Some of the lines are repeated. What I want to do is add a new column that counts the number of repetitions of each line. ...
0
votes
2answers
84 views

Extract X value from corresponding Y value from a List or Transpose [closed]

I have a list of X values and Y values separately, and also together with: data=Transpose[{X,Y}] This data is from a chromatogram, and I want to extract the ...
0
votes
1answer
66 views

Select duplicate values from a list [duplicate]

How can I select the duplicate values in a list? Example: {1, 2, 1, 1, 1, 1}
7
votes
4answers
379 views

Generating an Ulam spiral

An Ulam Spiral is quite an interesting construction, revealing unexpected features in the distribution of primes. Here is a related topic with one answer by Pinguin Dirk, who has provided one ...
4
votes
5answers
511 views

Convert a string into a list of numbers

I got the following problem I don't know how to solve or if it's at all possible to solve(I'm quite new to Mathematica and don't have an IT background, so please explain slowly if possible:)) I'm ...
0
votes
3answers
144 views

Trouble understanding a piece of code found on Wolfram Blog

I am trying to go through this Wolfram Blog example: http://blog.wolfram.com/2009/02/12/flag-analysis-with-mathematica/ on country flag analysis. I am having a problem understanding the following ...
1
vote
2answers
67 views

Replacing a specific pattern of values at level 2 in a list

I've a list of lists, tl = {{True, False, m12}, {False, m22, m33}, {m32, False, True}} and each nested list has the same length, What is the proper way to ...
3
votes
3answers
94 views

How to test if all the elements in a list are Integers? [closed]

Consider a list such as s={1,2,3,3,5,6,3} With IntegerQ[number] , you know if number is an ...
3
votes
2answers
219 views

Dealing with a huge dataset

I have two ingredients here: a big dataset contained in a list, with ~ 20M values. a function that takes as each element of the list as input and yields True or False I want to save somewhere the ...
2
votes
3answers
116 views

Delete Missing data from coordinate sets

I have a list of pairs of coordinates, where some are missing. ...
2
votes
2answers
131 views

Permuting elements within a list

I have s = {2, 3, 5, 7, 1, 4, 6} (* always with diffente elements in {1,2....7}*) l = Length[s] n = 3 and n tells us that we ...
0
votes
1answer
43 views

Resolving Error: Mathematica evaluation order on Lists

I have a table that is 27 x 27, each entry corresponds to an element from the periodic table. I use the replacement rules in element list to allow me to convert a list of elements into a list of ...
2
votes
2answers
90 views

Importing Data and Devoting Their Names to Them

There are some files in a directory. I have used of SetDiroctory to access all of them. SetDirectory["C:\\Users\\SE7EN\\Desktop\\mathematica\\test"]; I can visit ...
8
votes
4answers
281 views

Complement of multisets

Given lists $a$ and $b$, which represent multisets, how can I compute the complement $a\setminus b$? I'd like to construct a function xunion that returns the ...
2
votes
1answer
45 views

Complement for a Matrix

In a matrix, there are some non-zero elements same as: aA= Also, there is a list such as: list = {a, b, c, d, e, f, g, ii, jj, kk}; I want to access to ...
3
votes
2answers
177 views

make a list based on two other lists

I have two lists: list1={4,6} list2={1,2} and I now want a function f that produces f[list1_,list2_]:={1,1,1,1,2,2,2,2,2,2} ...
1
vote
0answers
35 views

A more efficient way of fitting a non-linear model that returns an entire list?

I have a function that takes two parameters, del and nu, and returns a list npoints long ...
4
votes
3answers
377 views

Efficient matrix / array generation

What is the most efficient way of generating the following matrix? $\left( \begin{array}{ccccc} 1 & 0 & 1 & 0 & 1 & 0 & 1 & \dots\\ \frac{1}{2} & \frac{1}{2} & 0 ...