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

learn more… | top users | synonyms (3)

21
votes
3answers
793 views

DeleteDuplicatesBy is not performing as I'd hoped. Am I missing something?

Déjà vu: a new-in-v10 function should provide a better solution to an old problem, but my enthusiasm is curbed when I run timings. This time the function is ...
0
votes
1answer
35 views

Interactively Manipulate SparseArrays or Lists

I'd love to use SparseArrayor List to group a set of parameters together in a function. ...
1
vote
1answer
68 views

Integers in Range have trailing decimal - how to remove?

I want to create a list like {0,0.2x,0.4x,0.6x,0.8x,1} If I try Range[0, 1, 0.2] x what I get is ...
2
votes
3answers
206 views

What is the order of faces on a D20? How can I optimize the order of faces on a D-n?

I am creating a customizable D20 for 3D printing using OpenSCAD, with the following code: ...
0
votes
0answers
57 views

deleteduplicates Delete elements of a list [duplicate]

I have a math problem about Mathematica, I am looking help from you. I hope that you could help me. The Math Problem: list= { {0,0,1},{1,0,0},{0,1,0} ,{1,2,3}}; ...
2
votes
2answers
47 views

How to further process a 2 dimensional list created with tuples

I created with Tuples[{{USD, EUR, JPY}, {UP, DOWN}}] the following result: ...
2
votes
3answers
156 views

How to display the indices/element positions of a ragged array?

I have a three-level ragged array like so: ...
2
votes
2answers
86 views

Adding a tree to a list of trees within a loop [duplicate]

I'm trying to write a function which for a list of trees checks if a given tree is isomorphic with any of the listed, and if not - adds it to the list. I tried to use both ...
1
vote
1answer
161 views

ListPlot[] code for CSV file not working

I have a CSV file with $9$ columns. I want to plot them in the following way. Column $1$ will be along the $X$-axis. Any point $(x_i, y_i)$ of $i$-th curve in the plot will have the $x$ value from the ...
4
votes
2answers
261 views

All possible pairs of two items

I have 4 different items {1, 2, 3, 4}. I want to obtain all possible pairs of two of the items. I have written: ...
4
votes
1answer
505 views

Why is there a huge performance gap using Map with more than 100 List entries

im using Map on a List like this: cube= {{1, 1, 1}, {1, 1, 2}, {1, 1, 3}, {1, 1, 4}, ... , {5, 5, 4}, {5, 5, 5}} Mapping the whole List with 125 entries takes ...
1
vote
1answer
79 views

Replace distinct values of list with values of another list

First of all I´m new to Mathematica; I´m trying to exchange distinct values of a list with values of another list (piecewise). I thought ReplacePart in combination ...
2
votes
2answers
71 views

How do I delete items at the same position from every sub-list within a list? [duplicate]

We have data in a list called megadata where megadata[[1]] for instance are the temperatures of each data point, ...
1
vote
1answer
94 views

Using Map in a function definition

I want to calculate the hessian of a matrix. So each element gets replaced by a 2 by 2 matrix. ...
3
votes
3answers
141 views

Elegant way for map a function over the columns of an array

I have an array data = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}; And I want map Standardize over the column of the array. I use ...
4
votes
2answers
136 views

Get part of lousy data

I want to get part of large data. some part of this data is as follows: ...
5
votes
3answers
277 views

Command to insert item into list

Is there a command to insert an item into a list such that they form pairs? In other words to take InsertObject[{a,b,c},d] which will output ...
1
vote
1answer
178 views

DeleteCases that match partially [closed]

Say I have a list of strings L , L2= "some_text-to-delete" and I want to delete all the Li that match with "text" or "delete" DeleteCase only gives the ones that match exactly...
0
votes
4answers
137 views

Using levels in MapIndexed

I am trying to use MapIndexed to manipulate a matrix of data but I am having trouble getting the levels parameter to work the way I would like. Suppose that my data ...
2
votes
3answers
133 views

Table to text string [closed]

I know this is a simple question and there is a single command to do this but I have been looking for the command for 30+ minutes and cannot find it. I have a list that I want to put tabs between ...
6
votes
4answers
735 views

Swap elements in list without copy [duplicate]

I have a lists with 100,000 elements and would like two swap to entries without dublicating the list Example: ...
2
votes
3answers
336 views

Backsubstituting solution into FindRoot and Plot

I want to find roots from a transcendental equation using FindRoot as a function of a real parameter and then plot the solutions vs. the parameter. The following commands work perfectly: ...
3
votes
2answers
101 views

Matrix of given size with unspecified elements

I want to generate a Matrix of given size whose elements are not specified I can use Array[a, {3, 2}] to get ...
1
vote
1answer
121 views

Inverting matrix of unknown size

I have a matrix that has a variable number of columns and rows (but it is always square). The matrix is: $$ \Gamma = \begin{bmatrix} \Theta & 0 & 0 & 0 & T & 0 & R_j \\ ...
0
votes
3answers
95 views

Positions of a string in a list [closed]

Sorry for the bad title..Didn't know how to describe this, feel free to change it to be more specific. I have a list in this form: ...
8
votes
8answers
727 views

Replace interior of matrix with zeros

I have f.e. the following square matrix: ...
0
votes
1answer
47 views

Constrain Fit to make a fit that remains positive over the range of my independent variable

For example, say I have the following data. ...
0
votes
1answer
48 views

Sort a multidimensional list row-wise [closed]

Suppose I have a multidimensional list as shown below: RandomInteger[{1,10},{3,7}] I obtain the results: $$ \left( \begin{array}{ccccccc} 3 & 8 ...
7
votes
4answers
702 views

How to find all data points within closed curve

I want to find all data points inside curve as given below: ...
1
vote
1answer
61 views

How to apply function on list of lists with different sizes [closed]

I am not good with slot management when it comes to 2D lists. What is the correct way to map a function on list of lists of different length, where the function needs to act of each entry in each ...
6
votes
7answers
338 views

A problem involving classification of data

Toady, I encountered a problem while trying to classify certain data. I have the coordinates of six points. ...
0
votes
1answer
62 views

Combining list x-y data with a list of errobars into one list (mathematica-style)

Suppose I have a list of data I can ListPlot: { {x1,y1}, ... } , and a list of y-errorbars: {erry1, erry2, ... } Is there ...
2
votes
2answers
194 views

Alternative for MapThread in listable functions

How can I rewrite this more efficiently taking advantage of flo, dem, and Nsup being ...
1
vote
1answer
102 views

references in a nested matrix

I have a nested matrix n: ...
7
votes
4answers
249 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
129 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
49 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
159 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
216 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
228 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
104 views

Comparison Operation for Nested Matrices

I have a nested matrix n as bellow ...
0
votes
4answers
92 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
418 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
461 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
99 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
95 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
94 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 ...
5
votes
2answers
260 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
141 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, ...