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

learn more… | top users | synonyms (5)

2
votes
4answers
272 views

Removing coefficients and repeated elements

I got to a problem where as I just can't find the proper Mathematica command. I'm given a list, for example: $\{1,x1,-x1,x2,x5,x3,-x2,-x4\}$ I need this to become $\{1,x1,x2,x3,x4,x5\}$ The ...
1
vote
1answer
154 views

Computing a mean of median list of points

Given a array of lists with the same number of here N = 10 elements: ...
0
votes
1answer
320 views

How can I build a GraphicsGrid of fixed size that rearranges the empty plots?

OK, let's make one final attempt; they say the third time is the lucky one! Following @rm-rf 's suggestions, I will try to be as clear as I can. My Mathematica code reads and plots simultaneously ...
6
votes
8answers
1k views

Finding the midpoints of an ordered list of numbers

Suppose that I have an ordered list of numbers. The numbers in the list may be evenly spaced, but they may not be. Here are two examples, list1 and ...
2
votes
2answers
540 views

How can I build a GraphicsGrid of arbitrary size?

This is actually a very simple scenario, in order to make simpler this question Part I. Consider the following piece of Mathematica code ...
3
votes
4answers
242 views

Test whether date is in a certain period

I have one table which contains time periods ("start" and "end") and a "type" for every ...
1
vote
2answers
106 views

Making two lists which share part of its name, while its name is also an element of the list

I am stalled with the following problem: I want two lists, for example: name={1,2,3} and namec={{1,2,3},{x,y,z},name} The ...
5
votes
2answers
203 views

Split a list of pairs at points with decreasing first element

I have a list in which the first index is mostly increasing, but dips sometimes. I need to split this list in two or more lists in this way: when the first element of a pair is smaller than the ...
10
votes
5answers
498 views

ListPlot under conditions

I have a data file containing several columns and thousands lines of data. Below I present a small portion of it, in order to express my issue: ...
0
votes
1answer
147 views

How to simulate a multivariate recursive system from a list

New to mathematica, trying to use Eric Swanson's Pertubation AIM program to solve DSGE models. His code produces a solution as a list or a table. My question is how do I use this list to simulate the ...
3
votes
5answers
1k views

Find the slope between adjacent points in a list

I have a list of two dimensional points that are ordered by their x-coordinate. I would like to calculate the slope between all adjacent points. I'm familiar with the use of pure functions in Sort ...
4
votes
2answers
245 views

Correlation with missing data

I have two lists, age and score, that I want to find correlation on for 50 people. For some people, the score is blank. Example data: ...
4
votes
1answer
556 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 ...
1
vote
1answer
72 views

List-manipulation Interpolation

For example, I have the following list: AA={{0, 20000.}, {26.6, 19950.}, {53.2, 19950.}, {79.8, 19950.}, {97.1198, 18644.1}, {102.681, 16452.3}} Another ...
2
votes
0answers
65 views

How to create a ListPlot containing two lists? [duplicate]

I'm trying to plot a set of points where one list corresponds to the X values another list corresponds to the Y values. I have ...
5
votes
2answers
350 views

Building conditional lists with Manipulate

I'm trying to select elements of a list that satisfy some criteria using Manipulate[]. Given 2 lists: ...
3
votes
3answers
235 views

Renaming a list with name obtained interactively

I have a list say: m = {1, 2, 3} The list is inside a package, and is the result of a calculation. I want to give the user the option to rename it, for example ...
1
vote
1answer
229 views

Averaging multiple 2D data sets

I have multiple data sets, each of which is a 2D matrix. I want to construct a new 2D Matrix in which each element is the average of that element for all the original data sets. i.e ...
-5
votes
1answer
405 views

Split dataset based on the first column [duplicate]

I have a dataset which I want to split based on the first column. The data looks like this ...
1
vote
1answer
190 views

Extracting values

I have imported a data from an excel sheet. I want to extract parts of the list based on some conditions. First I want to create one list whit the The Coca-Cola ...
2
votes
2answers
123 views

Automatically generated summation region

In a multiple Sum I need to put an automatically generated summation region. But when I generate the summation region automatically I get a list whose elements are ...
6
votes
4answers
359 views

Inserting points along a linear interval between adjacent coordinates in an array

Say I have a list of coordinates in an array {{0, 0}, {0, 1}, {1, 1}} I'd like to create a new array where, between each pair of nearest-neighbor coordinates in ...
9
votes
3answers
601 views

Creating a simple function to compute the average of the difference between pairs of elements in an array

I have a list of the form: {{{1, 2}, {3, 4}}, {{5, 6}, {7, 8}}, {{9, 10}, {11, 12}}} How can I create a function which will take each set at the highest level of ...
3
votes
2answers
133 views

Incrementally revealing Grid (or TableForm) entries

I have a Grid (or TableForm) object like this ...
6
votes
5answers
221 views

Multiple level lists

Let there be a list, Sample={{{1, 2, 3}, {a, b, c}}, {{2, 3, 4}, {d, f, g}}} I want to go to individual sublists and do some operation on it.I tried a few things ...
3
votes
1answer
838 views

A rotation-like transform on a matrix

Do not be confused with comments, those are for previous version of the question - Kuba Imagine I have a matrix of the form: ...
5
votes
2answers
274 views

How to group lists that own one common element?

I have produced a list of sub-lists by the following: ...
5
votes
4answers
251 views

Picking numbers within a list with an interval of 60

I have a list of integers from 1 - 400. I choose n random numbers with replacement from the list. Here is an example: ...
9
votes
2answers
413 views

Intersection for lists of numeric data

I know that Intersection is a pattern matching function and will not evaluate list elements to determine if two or more list have equal elements. So my question is, ...
6
votes
1answer
2k views

Mutual Information involving two matrix states

I basically retrieved the following technique of evaluating the mutual information involving two matrices from this site at http://bmia.bmt.tue.nl/People/BRomeny/Courses/8C080/default.htm The ...
8
votes
4answers
517 views

Gather list elements by index

The following list has some elements that are labeled. For example {1, 2} -> 1, {-1, 3} -> 3, etc: ...
6
votes
2answers
240 views

How can I use Pick to select items in one list when a value in a corresponding list is $\leq$ some value?

Imagine I have two lists: List1 = {0, 1, 0.6, 0.5, 1.2, 0.4}; List2 = {"a", "b", "c", "d", "e", "f"}; How can I use Pick to ...
0
votes
2answers
158 views

Create a Matrix out of two matrices

I have two matrices A = {{a1,a2},{b1,b2}} and B = {{x1,x2},{y1,y2}}. I would like to create out of these matrices a new matrix ...
0
votes
0answers
46 views

List elements and iterator name collision [duplicate]

Let there be two lists, exp = {{i, i}, {j, j}}; exp2 = {{r, r}, {o, o}}; and there are two Table commands to access them. Then, ...
11
votes
6answers
377 views

Using MapIndexed only at certain elements of a list

MapIndexed is a very handy built-in function. Suppose that I have the following list, called list: ...
10
votes
5answers
574 views

Span a function across several consecutive elements in a list

Suppose that I have a list called list. I would like to span an arbitrary function f across specified consecutive elements in ...
2
votes
1answer
104 views

Map and Scan ignore HoldFirst

I am trying to write a simple function that takes a list of data and outputs it to a file. I'd like the name of the file to be the same as the variable that holds the list. It seems that giving a ...
1
vote
1answer
152 views

Ways to access lists inside lists

I have gone through some reference material but I am not getting really good links that will help me grow understanding of ...
2
votes
2answers
211 views

Replacing all values in a table > $T$ [duplicate]

I want to generate a table of Euclidean distances from the points in a list to a given point, e.g.: ...
4
votes
2answers
233 views

How can I replace the general element of a geometric series with the sum of the series?

Consider the list mylist = {b(a/bc t)^r, a/b(b t)^r, a (c/d t)^r, ...} where a, b, c, t, etc., are real numbers between 0 and 1. I want to sum each term in the ...
1
vote
1answer
246 views

merge daily and hourly time series data

I have two lists of time series data. One of the lists is daily and is formatted like this; ...
4
votes
2answers
247 views

Multiplying expressions within a list of pure functions

Let's say I have a list of pure functions that are nice algebraic expressions: say l = {(#1 - 1)&, (#1^2 + #1)&, (#1^3 - 1)&} What's an easy way to ...
2
votes
2answers
174 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 ...
0
votes
3answers
104 views

How can I generate a generalized product to two lists in a special way? [duplicate]

Let's say I have two lists, and I'd like to generate a "cartesian product" from these two. Specifically Inputs: A = {{{1}}, {{2}}, {{1}, {2}}}; B = {8, 9}; ...
0
votes
0answers
75 views

Importing specific columns of a .txt file [duplicate]

I have text delimited file, with data in four columns. How to use ReadList to extract only the first and the fourth column.
0
votes
2answers
169 views

How to put a list of values on a single axis and add custom labels

I have a table in the following format: Apple 2 Pear 3 Banana 5 Orange 6.5 .... I would like to put the values on a single horizontal axis and add corresponding descriptive labels (apple, pear, ...
7
votes
9answers
496 views

Convert list of lists to cumulative join

I have this: list[1]={1,2,3}; list[2]={7,8,9}; list[3]={15,20,22}; I want this: ...
2
votes
2answers
851 views

Building a new table by repeating elements from another table

I have a small problem that I cannot solve. I have two tables, one with three elements: a = {0, L/c, 2L/c}; and the other with 9 elements, all 0: ...
2
votes
2answers
1k 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 ...