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

learn more… | top users | synonyms (3)

2
votes
3answers
119 views

Quickly plotting (number of events) vs. (time) for a very large number of events encoded as pairs of real numbers representing start and end times

I have an array that looks like the following: exampleArray = {{t1,r1},{t2,r2},{t3,r3},{t4,r4},{t5,r5},...}; Where each pair of real numbers $(t_k,r_k)$ ...
2
votes
1answer
273 views

Using Thread or MapThread over multi-level, ragged lists [duplicate]

This may be a rather strange question. I will try to create a sort of minimal working example. Suppose that I have two lists, list1 and ...
2
votes
2answers
138 views

Extracting counts of contiguous zeros and ones from a binary array

I'm a novice with Mathematica, but you guys have been very helpful to me in the past. I have a binary array [100, J repetitions] consisting of zeroes and ones. I'd like to extract a histogram of the ...
2
votes
2answers
212 views

Removing pairs that meet a given criterion from a list [duplicate]

Let $(x_{min},x_{max})$ and $(y_{min},y_{max})$ represent lowerbound and upperbound acceptable values for some coordinate $c_i$. Setting $x_{min} = y_{min} = 1$ & $x_{max} = y_{max} = 9$, how ...
2
votes
2answers
123 views

Select rows of matrix that are higher than a given row

Imagine I have the following matrix: X={{0,0,0},{1,0,1},{1,1,1},{1,2,1},{3,3,3}}. I want to select the sublists that are greater or equal than this list ...
2
votes
2answers
781 views

Importing several huge files with headers & footers

having here several files in ASCII format http://ge.tt/91rv0Jf/v/0 I want to import, while removing headers and footers and then join the several lists. ...
2
votes
2answers
301 views

How to prevent errors in Manipulate with ListPlot when a result is an empty list?

I am trying to plot two lists, where one is the reference list, and the other is only used to select and highlight the first list. Basically, I want to use the selection list ...
2
votes
2answers
152 views

Modify a sub-part of a sub-list only

I have this list: a = {{{0, 0}, {1, 7}, {2, 0}, {3, 2}, {4, 7}}, {{0, 0}, {1, 0}, {2, 1}, {3, 2}, {4, 7}}} and I'd like to transform it to this: ...
2
votes
2answers
150 views

How can I replace part of list and have the replacement affect the initial list?

I have a list: list = {{1,1,0.05,0.05}, {2,2,0.05,0.05}}; and I want to do this change ...
2
votes
1answer
1k views

Filtering Lists in Mathematica [duplicate]

Possible Duplicate: Select/Delete with Sublist elements? I need help in filtering long lists of x,y coordinates.Lets use the following list as an ...
2
votes
1answer
196 views

Computing closest set of points to each point in large set — running out of memory (arrays unpacking)

I have a large set of points in 3D and I'm trying to identify all the points that lie within a certain distance of each point. Then using this data store the vector between the pairs of points. I ...
2
votes
1answer
138 views

Specifying form in MemberQ

This seems like a very simple question, the answer to which should be obvious to me. So I won't be offended if this question is closed. But I'm having trouble figuring out the answer. I would ...
2
votes
2answers
385 views

Mathematica: summing over n abstract indices

This probably has a one line answer, but I'm totally stuck. I have two tensors, i.e. two objects that depend on NN abstract indices which i've labelled ...
2
votes
1answer
134 views

Intersection of conditions

If I have a list of conditions: {cond1,cond2,cond3} and I want to use an If[] statement to test the intersection of these ...
2
votes
1answer
208 views

How to get the results of Tally split into two separate lists

This is a kind of a followup to my previous question. I am starting with a long list of plane coordinates, like this one: ...
2
votes
2answers
147 views

Constraining a random function

This question is a follow-up from here. I have a function that generates a list of correlations between some random variables: ...
2
votes
1answer
431 views

Adding rules to permutations

How can I calculate only those permutations of Range[n], that satisfy certain rules? I don't want to filter the result after calculating all the permutations but ...
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
76 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
108 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
137 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
65 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
523 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
143 views

Join matrix based on conditions

Given the following matrix: ...
2
votes
1answer
79 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
390 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
190 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
146 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
1answer
297 views

How do I sort complex numbers?

Okay, so I posted something about sorting, and it was linked as a duplicate to This post However, I am having problems trying to sort a list that contains both real and complex numbers. I put them ...
2
votes
2answers
209 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
475 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
193 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
159 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
86 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
117 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
75 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
105 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
167 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
130 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 ...