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

learn more… | top users | synonyms (5)

2
votes
1answer
333 views

How do I create a histogram out of this datastructure: x[i] = value_i?

Here is my SSCCE: a[1] = 2; a[2] = 3; a[3] = 6; Histogram[a] This throws and error though. Here are my questions: What kind of data type is a? Is it an Array?...
7
votes
4answers
547 views

Filter list based on date

What I would like to do is remove entries from a list of instrument data when it is in maintenance. The maintenance data I have is a series of dates which look like this; ...
0
votes
2answers
297 views

How to get a sub range of a larger matrix?

This should be an easy question but I only found a partial solution using All. Say I have a matrix A = 1000 x 5, how to get only a part of that matrix, say B = n x ...
4
votes
3answers
4k views

How to convert output of a For loop into a list

I have written a For loop in my Mathematica notebook. This For loop, when activated, will generate a sequence something like: ...
6
votes
2answers
543 views

How can I force points in a list to have distinct x values?

I have a list of points that may be used for linear interpolation using Interpolation and need to ensure that no two points have the same $x$ value, since, if they ...
2
votes
4answers
256 views

Order of operations for the Table function [duplicate]

Possible Duplicate: Using pure functions in Table I have run into a situation that I do not understand when trying to generate a nested list of pure functions. I have the following code. <...
5
votes
2answers
196 views

How to efficiently find multimap k-itemset frequency

I am doing this to learn association rules. The data d is in format {id, value}, for example: ...
1
vote
3answers
242 views

Selecting a Point that has the Lowest Absolute x/y-coordinate From a List of Points

Given that there is a set of points, for example, {{3,4,2},{5,2,-1}}. How do I go about selecting the point that has the lowest absolute x, y or z-coordinate from ...
5
votes
3answers
293 views

Self-referential list or table of buttons

How could one create a table or list of buttons, such that clicking on a button removes the button itself from the list?
1
vote
0answers
95 views

Non Commutative Multiply [duplicate]

Possible Duplicate: Non-commutative symbolic linear algebra I want to multiply two matrices, for example, A = {{e, f}, {g, h}} B = {{a, b}, {c, d}} Using ...
5
votes
2answers
460 views
7
votes
5answers
306 views

Making a table with elements like {10i+j, i, j}

Table[10i+j,{i,4},{j,3}] will generate a table that looks like this: {{11,12,13},{21,22,23},{31,32,33},{41,42,43}} I would like ...
2
votes
3answers
200 views

Rearrangement of the list

I have the following list: ...
2
votes
1answer
241 views

Rearranging a biclustered matrix

I currently have a $77\times 38$ matrix, and I have used a clustering algorithm to cluster the row data and column data. The rows and columns of my matrix correspond to a list of country codes (not in ...
1
vote
2answers
152 views

Return a string from a vector containing a string and a number

I currently have a List of the form, {{String_1, 8.}, {String_2, `101.}, {String_3, 37.}, ..., {String_n, 28.}} Along with another list, ...
5
votes
1answer
388 views

DeleteCases messing with my mind

I'm losing my mind. Please tell me my laptop is doing weird things and not me. Or do I need to get committed someplace? ...
11
votes
3answers
305 views

Threading over a list of lists of lists and a list of atomic expressions

Although I solved the following problem using MapThread, I'm curious about why Thread does not work as I expect it to here. ...
10
votes
2answers
717 views

Fluorescence Correlation Spectroscopy Simulation

I am simulating Fluorescence Correlation Spectroscopy which basically involves tracking the random motion of particles in a box with periodic boundary conditions and then calculating their intensity ...
7
votes
3answers
786 views

What is the correct way to conditionally add elements to lists? [duplicate]

Possible Duplicate: How to avoid returning a Null if there is no “else” condition in an If contruct I have several situations where I need to conditionally add an element to a list, at various ...
1
vote
3answers
261 views

Adding headers to sublists

I would like to transform the following list: ...
6
votes
2answers
203 views

Can Tuples help simplify this?

I have a list {1, 2, 3, 4} and wish to form {{{1,2},{3,4}}, {{1,3},{2,4}}, {{1,4},{2,3}}} I ended up doing it manually ...
9
votes
2answers
254 views

How to find synchronization offset?

I have 2 sets of data containing delays (audio / video). ...
7
votes
3answers
308 views

Restricted accumulation of values

Please consider the following list data. I was trying to accumulate data until the result turns positive the first time and ...
5
votes
1answer
652 views

Numbering element in descending order

How can I numbering the elements in descending order of second elements of sublists? For example, if I have the list which is ...
5
votes
5answers
356 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 ...
3
votes
2answers
331 views

Deleting a row or column of an adjacency matrix while maintaining the associated label

I am currently working with a weighted adjacency matrix for a directed graph, and it contains several 0 columns and rows. With the unaltered matrix, I am able to monitor the relations between vertices ...
4
votes
1answer
311 views

Use single ListPlot for multiple sets of data (on separate graphs)

This is the code I have working for a single set of data. Is there a way I can structure this to have multiple sets of data? ...
3
votes
2answers
2k views

Trying to generate a list of data to plot a graph with error bars. Need help creating the looping function

This is the sets of data I want to put into a form which will allow me to plot error bars from the min and max data. ...
14
votes
9answers
718 views

Thread over list in different levels

I have these two lists, both with the same length in the first dimension: ...
3
votes
1answer
217 views

How to efficiently take complement of two big lists?

I have a giant list l1 and some smaller lists l21, l21, ..., ...
1
vote
3answers
342 views

Logical operations on a list [duplicate]

Possible Duplicate: Applying And to lists of Booleans I have two lists filled with logicals: ...
11
votes
4answers
410 views

What's fastest way of defining 10^5 down values?

I want to define isGood[___] = False; isGood[#] = True & /@ list where list is a list of several million integers. ...
5
votes
3answers
173 views

Comparing Unequal Lists of Surnames to Establish Over or Under-Representation

I've been using Mathematica to explore historical records. I have two long lists (one is 69k, the second 17k) of unequal length. They are like so (FWIW, the first list is the first 40 entries from the ...
4
votes
3answers
483 views

Generate a Combination of letters by a number

I'm trying to write a function f. example: ...
8
votes
3answers
6k views

Local max/min of Mathematica data sets

Is there a way in Mathematica to find the local maxima of a set of points? Suppose you have ...
8
votes
3answers
2k views

Transform a Sum into a List

I want to turn a sum like this sum =a-b+c+d Into a List like this: sumToList[sum]={a,-b,c,d} How can I achieve this?
4
votes
2answers
337 views

How can I use Max[] in a function that is passed a list not find the max of the list

For most functions in Mathematica, passing them a list will call the function on each element of the list. For example: ...
0
votes
3answers
2k views

How to make all values positive?

So I have a list of data that contain both positive and negative values, and I am wondering what I have to do in order to make all the numbers positive.
3
votes
3answers
594 views

How to pull scalars out of a function that should act on lists?

Suppose I have A = a vecA B = b vecB where a and b are supposed to be arbitrary scalars ...
0
votes
2answers
120 views

How to evaluate the sum using values from the data being input

I have a problem in evaluating a sum using values from data I input. Suppose I have data = {1, 3, 5, 6, 8} If I want to evaluate the sum of my data (1+3+5+6+8), I ...
2
votes
1answer
174 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 ...
1
vote
1answer
777 views

Using 'Reduce' to solve a set of inequalities, specified by a list

I have a two lists $LHS$ and $RHS$, both of size $n$. I want to solve a system of inequalities of the form: $$LHS[1] \leq RHS[1]$$ $$LHS[2] \leq RHS[2]$$ $$LHS[3] \leq RHS[3]$$ $$\vdots$$ $$LHS[n]...
2
votes
1answer
140 views

Generating continuous products or sum

This is kind of a continuation of this question. I want to automate these 2 steps on Mathematica once I give an integer $N$. generate a list of variables $\{a_i\}_{i=1}^{i=N}$ then for some ...
13
votes
4answers
2k views

Reshape vectors exactly like in MATLAB

This gives a 64×1 column vector in Mathematica: ...
7
votes
4answers
2k views

Alternatives to While Loops?

I am using Mathematica to run a probabilistic simulation. Essentially, I have a list of members of a population (they only have one, numerical, attribute, so it's just implemented as a list of ...
3
votes
2answers
739 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 ...
12
votes
4answers
581 views

Calculate proportion of values for dates

At work, we were discussing when is it the best time to change to winter tires for bikes and/or cars. Using WeatherData[] and ...
16
votes
6answers
501 views

Splitting a list by specifying section headers

I have a list of strings called mylist: mylist = {"[a]", "a", "a", "[b]", "b", "b", "[ c ]", "c", "c"}; I would like to split ...
7
votes
1answer
686 views

Find all permutations with reversals / cyclic permutations removed

I have a list of all non-cyclic permutations of n labels. How can I get rid of all elements which are redundant in the sense that they are the inverse of another one. For instance if n=4, the ...
2
votes
3answers
690 views

Maximum tuple value

Is there a simple way to make a maximum tuple value (similar to python)? For example, in python max([ (1,2), (1,3), (3,1), (4,0) ]) returns ...