Tagged Questions

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

281 views

Question2:: ...
159 views

Map 2 list to a function

Im playing around with CountryData and I want to pass it 2 lists as argument, listCountries = {...} and ...
147 views

Symmetric list with maximum in center

How to sort a list, e.g. RandomInteger[{0, 100}, 50] that the Maximum is in the center and all other elements are placed symetrically in descending order around ...
303 views

Binarizing a matrix

I have an image with a few bright pixels with the remaining ones very dark. The difference is in orders of magnitude. I want to binarize this matrix (corresponding to the image) making all values ...
207 views

Speeding Up Replacing of Labels in Large Matrix?

I am Mathematica novice and am trying to find a fast way to replace labels in some rather large matrices (512x512 or 1024x1024) that have resulted from segmenting images with WatershedComponents or ...
993 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 ...
48 views

Interactively Manipulate SparseArrays or Lists

I'd love to use SparseArrayor List to group a set of parameters together in a function. ...
82 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 ...
354 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: ...
63 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}}; ...
50 views

How to further process a 2 dimensional list created with tuples

I created with Tuples[{{USD, EUR, JPY}, {UP, DOWN}}] the following result: ...
202 views

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

I have a three-level ragged array like so: ...
92 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 ...
478 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 ...
292 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: ...
559 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 ...
133 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 ...
181 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, ...
109 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. ...
169 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 ...
141 views

Get part of lousy data

I want to get part of large data. some part of this data is as follows: ...
298 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 ...
331 views

DeleteCases that match partially [duplicate]

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...
150 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 ...
154 views

Is there is a design problem or documentation problem with FirstCase?

In version 10 the new function FirstCase can take up to 4 arguments (plus option). The third argument is a default value to be returned if there is no match: ...
2k 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: ...
776 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: ...
121 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 ...
150 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 \\ ...
164 views

Positions of a string in a list [duplicate]

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: list = {"a(0)", "a(1)", "a(2)"} ...
761 views

Replace interior of matrix with zeros

I have f.e. the following square matrix: ...
62 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. ...
345 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. ...
113 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 ...
213 views

Alternative for MapThread in listable functions

How can I rewrite this more efficiently taking advantage of flo, dem, and Nsup being ...
113 views

references in a nested matrix

I have a nested matrix n: ...
297 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 ...
170 views

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

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 ...
66 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. ...
177 views

Getting good-looking matrix form output from a matrix having both scalars and matrices as elements

I have a nested matrix n: ...
200 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 ...
305 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 ...
235 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 ...
125 views

Comparison Operation for Nested Matrices

I have a nested matrix n as bellow ...
122 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: ...
2k 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. ...
523 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 ...
296 views

Assign values to variable names in lists [duplicate]

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