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

learn more… | top users | synonyms (3)

2
votes
2answers
129 views

A question about transforming one List into two Lists with additional requirements

Background: I create geometric patterns by applying many linear transformations on geometries, I need functions to weed out the exponentially increasing number of ( unnecessary ) points involved which ...
2
votes
1answer
74 views

How to build a list of constraints for NMinimize

Let's say I have aset = {-1, 0, 2}. I would like to create a variable Var that takes values from that set, i.e. ...
2
votes
4answers
99 views

Import xls data with dates

I have an excel table that have 2 columns, the first one are dates, and the second one are values. I want to plot the value vs the date. I need to: first clean all the non numbers strings like ...
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 ...
2
votes
1answer
69 views

Using Total on a list supplied by a rule

I'm confused as to why Total complains about a nonatomic expression here: ...
2
votes
1answer
64 views

Identifying and isolating sections of overlap in a set of integer intervals

I have a very large array like the following: {{1,10},{8,9},{9,20},{34,40},{41,42},{43,50},{47,53},...}; Now, imagine that every element in the array corresponds ...
2
votes
1answer
495 views

Contracting with Levi-Civita (totally antisymmetric) tensor

I have an array $v_{ijk}$ which is effectively a rank-$3$ tensor with dimensions $3\times3\times3$, and I need to contract it with $e^{ijk}$, i.e. evaluate $v_{ijk} e^{ijk}$ (see Einstein ...
2
votes
3answers
142 views

Join matrix based on conditions

Given the following matrix: ...
2
votes
1answer
76 views

Intersection does not take list of lists

The function Intersection takes a number of lists (sets) and finds their intersection. However, the precise input is ...
2
votes
1answer
371 views

Calculate mean square displacements for different particles from a excel file

I have the particle movement data in the following format: ...
2
votes
2answers
189 views

Iteration problem

I am trying to write a simple program - perform f1 as long as t is smaller than 800. t is ...
2
votes
1answer
112 views

Can Map operations be compiled or otherwise sped up for large lists?

I'm performing a series of Map operations in the following script: ...
2
votes
1answer
142 views

How can I randomize the elements of a list?

Is there a straightforward way to go from an ordered list like: ord = {a, b, c, d, e, f, g, h} to a disordered list like: ...
2
votes
1answer
67 views

Adjust the results of evaluating Table so it can be used as a argument to Point

I have a list generated by Table as below. ...
2
votes
2answers
202 views

Create list via checkboxes

I am trying to achieve the following: Three (dynamically updated) Checkboxes (a, b and c) can be toggled on or off individually. Depending on their status, a ...
2
votes
1answer
110 views

Flat function with repeated sequence

There are functions like Join[ ] that accept a variable number of arguments. Join is a flat function, as the order of arguments ...
2
votes
2answers
460 views

Making NIntegrate behave like a listable function

I have a function defined by $$f(t)=\int\limits_0^t g(x) dx$$ $g(x)$ is a complicated function (specifically the Mittag-Leffler function which has recently been implemented in Mathematica 9 as ...
2
votes
2answers
191 views

Simple manipulation of imported data

I am importing 2 columns of numeric data from a data file in the way defined in this answer: ...
2
votes
1answer
158 views

Issues with a Counter that is tallying term appearances

I am working with an array of textfiles, trying to see how frequent certain terms are. However, I am running into some difficulty with my running counts of bigram frequency. Here is a snippet of my ...
2
votes
2answers
122 views

Map 2 list to a function

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

Extracting “records” from a matrix

From a rank 3 matrix like ...
2
votes
1answer
85 views

Restoring the 1-to-1 correspondence between elements in two lists, where one list is used as a guide to prune elements from the other

when we wish to use one list to select items from another using something like Pick, writing the following code, for example, causes us to lose the 1-to-1 ...
2
votes
2answers
84 views

adding vectors of unequal length [duplicate]

If I have hundreds of vectors of unequal length that I need to sum, what is the cleanest way to do so? So, if I have as input inp={{a,b,c,d},{e,f,g},{h}} I want ...
2
votes
1answer
51 views

Conditional clustering of elements

I have a long list like: ...
2
votes
1answer
81 views

MapThread over a nested list

This may be a simple question. Please close it if it is already answered. I have a nested list kr = {{35, 32, 27, 20}, {36, 33, 28, 21}, {37, 34, 29, 22}} I ...
2
votes
2answers
182 views

Plotting data in a weird format

I have a lot of data on the following form: data = {{param1,param2,param3,param4,{{x1,y1},{x2,y2},...,{xn,yn}}},...} The first variables in each sublist are ...
2
votes
3answers
114 views

Plotting lists, exact color values

I read some descriptions of similar problems but I cannot make them work in my example, I don't know why. I have list of 3 dim values to plot: x, ...
2
votes
2answers
73 views

How can I generate a variable-length list of options in PieChart?

I would like to allow a user to manipulate the segments of a pie-chart, which is to be generated from a list of a specific format. The code looks something like the following: ...
2
votes
2answers
120 views

Interpolating a list with exclusion [closed]

I have a list, data, where the elements data[[i]] range over i from ...
2
votes
1answer
103 views

How to make an efficient difference of sets function?

How to write a nice code that removes all elements from given set A, that occur also in set B? I would like to use DeleteCases[] for this purpose, but have no good ...
2
votes
2answers
165 views

How to select elements from a 4D Array?

I am very new to Mathematica (first time!) and I'm already having troubles with arrays. I basically have a 4D tensor, that is a matrix (call it M) which has for ...
2
votes
1answer
124 views

How to extract the bin width from a Histogram made with an automatic binning method?

I am using the Scott binning method with Histogram and Histogram3D to plot some data. How could I find out the bin width chosen ...
2
votes
1answer
135 views

Replace a specified portion of an array with elements from another smaller array

This may be a trivial question, but I have been at it for a couple of hours and I have not made much progress. I have a 10 x 10 array (T) that I have used to generate an 8 x 8 array (Q). I want to ...
2
votes
1answer
128 views

Error in setting matrix elements [duplicate]

Possible Duplicate: How to Set parts of indexed lists? For better organization of my code, sometime I use data objects in the form: ...
2
votes
3answers
217 views

Adding elements in the sublists

How can I add the elements in the sublists? For example, if I have the list which is m={{1,3},{2,3},{4,1}} then, the output that I want is ...
2
votes
3answers
222 views

Taking only particular subsets and doing calculations

I have subsets formed from a list using the Subsets command and want to do a particular calculation, lets say subtraction using the ...
2
votes
1answer
229 views

Conditional Data Selection, efficiency

Building up on the solution proposed here : Simplifying nested If statements You can find here the data set : allGazes.dat ...
2
votes
2answers
121 views
2
votes
2answers
40 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
2answers
73 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 ...
2
votes
2answers
45 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, ...
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 ...
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 ...
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 ...
2
votes
1answer
175 views

Is there a better way to create my rotational-symmetric (180 degrees) rectangles?

I have created a simple way to create rotational-symmetric (180 degrees) rectangles, but my stuffit function bothers me. No matter what I tried, I couldn't get it ...
2
votes
1answer
89 views

Explore a nested list

This question is similar to Numbering nested list according with Depth (or Level) I have a list like ...
2
votes
2answers
130 views

Generating an editable table that can be used as input

Say I have a number $n_{max}$. I want a command to generate a table like 1 1 2 2 3 3 4 4 ... nmax nmax where the second column is editable, and this table can be ...
2
votes
2answers
58 views

Specifying an array with a specific number of copies of two elements

To specify an array of length L in Mathematica, where each entry is someElement, I'm accustomed to writing: ...
2
votes
1answer
70 views

Convert Integer to Numeric with Replacement rules

I have a long list of triples, each looking something like {AGO, 1988, 2345.23}. Some of these, however, have an integer in the third spot, like this: ...