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

learn more… | top users | synonyms (3)

11
votes
7answers
380 views

Concatenation of lists in a Fibonacci-like pattern

I am trying to create a List of elements that follow the general pattern: $$X_{n+1} = X_n X_{n-1}$$ where the operation on the right hand side is concatenation, i.e., joining. I want to achieve the ...
0
votes
3answers
93 views

How to get the indices of values in a list which are NOT an specific integer?

I got a real array A, where Dimensions[A] == {5000, 5000, 5}. Some of the values in A are ...
4
votes
2answers
172 views

How to insert / merge a list into another list?

Background: I am working on a 2D geometry algorithm where I need to insert a list of 2D points into another list of 2D points. Somewhat to my surprise I found no Mathematica function capable of doing ...
11
votes
3answers
348 views

How can I remove the singleton dimensions of an array? [duplicate]

If I have an array A, for which Dimensions[A] is {9, 9, 1, 1, 3, 4}, how can I convert ...
3
votes
2answers
331 views

Filtering and Replacing outliers

I have a set of data that measurements of temperature vs time (date). It is easy to realize when the sensor went wrong as one might see a blip on the data. How to teach to Mathematica to: 1) Detect ...
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
5answers
182 views

How do I find the maximum value from the given set of data?

I have a set of data like {{x1, y1},{x2, y2}, ...,{xn, yn}}. From this data can I find the value of x for which ...
0
votes
1answer
82 views

Use a pre-computed list instead of RandomInteger

I would like to replace RandomInteger[{1, 10}, {10, 10}] in the following code: ...
5
votes
2answers
183 views

Interactive grid

I would like to create an interactive grid, whereby one number from a grid is selected by the cursor ("3" in the example below), and all other numbers in the grid are highlighted that are related to ...
0
votes
2answers
137 views

Combining graphics & lists / tables

I have: created with: ...
1
vote
1answer
113 views

How can I pass in parameters for multiple controls to a function that returns a Manipulate?

For instance, I have a some "commands" that I use regularly, for example: ...
0
votes
1answer
131 views

Interpolation problem on the list

I have a List of Latitude, Longitude and Measurement. a = {{{93, 104}, 290}, {{94, 103}, 292}, {{95, 105}, 291}, {{97, 109}, 294}, {{97, 102}, 295}}; And, I ...
0
votes
1answer
100 views

replace is not happening for specific vector valued expression

Given x[t_] := {Subscript[x, 1][t], Subscript[x, 2][t]} following replace works fine x[t] /. x[t] -> 0 0 but following ...
5
votes
4answers
178 views

How to delete mirror symmetric point pair efficiently

Look at following pic There are five points, I can generate the following point pairs ...
8
votes
4answers
287 views

Generate PrimePower counting function

Is there a way to generate a counting function for prime powers - i.e. to create a similar function to PrimePi, but including prime powers. The following will, of ...
1
vote
2answers
108 views

Delete duplicates from hierarchy of lists

Is it possible for Mathematica to compare a number of lists of different sizes, and delete duplicates in a hierarchical manner? For example, given the following lists: ...
1
vote
3answers
194 views

Generating a list of cubefree numbers

I am trying to generate a list of cubefree numbers (i.e. numbers when prime factorized contain no tripled factors) within a given range. Of DivisorSigma, ...
3
votes
1answer
71 views

Why does Thread FileDate give an error message?

I tried for example Thread[FileDate[FileNames["new*", "h:\\temp\\", 1]]] It gives FileDate::fstr: File specification ...
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 ...
18
votes
5answers
459 views

How to split list into disjoint lists?

I wonder if there is any simple way to split a list into its disjoint sublists, e.g. from list={{a,b},{e,f},{b,c},{c,d},{f,g,h}} get a result ...
0
votes
0answers
43 views

is there a way to speed up rule replace? [duplicate]

I am currently doing calculation with 7 parameters, each parameter set corresponding to a value. And I store the data in the format as a list of rule, like following ...
2
votes
2answers
249 views

Covariance of a P x M x N matrix

I have a stack of tiff files. When imported to Mathematica, they form a $P \times M \times N$ matrix, where $P$ is the number of single images in the stack, $M$ is the number of horizontal pixels and ...
0
votes
4answers
93 views

Seek a quick way to bring standard order back to original after Complement [duplicate]

the Complement gives result in standard order. But that's not what I want. I want it to keep the original order. say I have a list ...
0
votes
1answer
197 views

Passing lists to functions in a manner that works like pass-by-reference in other languages?

Is it possible to use a list as a variable, i.e., to pass it by reference to a function? In particular, I have a two-dimensional array and a function to get one element specified by its position: ...
5
votes
7answers
386 views

How to find the longest matching sublists in a list

Given a list of 2D points, i.e. {p1, p2, ..., pn} the list may contain equal points, i.e. pi = pj. In this case it may also be true that a sublist of ...
4
votes
1answer
120 views

Timing Total crashes kernel

Here is a simple test function test[n_] := Module[{i = 0}, Total[Nest[{++i, #}&, {0}, n], -1]] On my system V9.0.1 running OS X 10.6.8 and with a clean ...
1
vote
3answers
399 views

ListPlot multiple datasets over same x-values

Is there a better way to enter my data into a list plot? ...
5
votes
4answers
225 views

How to split a list with respect to its nested sublists?

I have a problem with the following task: having some nested list list = {{k6},{k1,k3,k5},{k7}} I would like to replace all sublists by their permutations and ...
2
votes
6answers
208 views

Manipulating List

I have a list: b={{1, 1}, {2, 2}, {3, 3}, {5, 5}, {6, 6}, {8, 8}, {10, 10}} I want to insert the elements in this list: ...
1
vote
0answers
70 views

The number of real values assumed by combinations of complex roots of a decic

Define complex conjugate as the pair of complex numbers $a+bi,a-bi$. Assume you have 5 such pairs and they are the 10 roots $x_i$ of a 10th-deg equation with integer coefficients. In general, how many ...
6
votes
9answers
528 views

combining and comparing lists

I have 2 lists (of lists), where most of the contained lists match. That is, the lists contained in list1 mostly match the lists contained in list2. In this simplified example each of the inner ...
14
votes
5answers
343 views

Partitioning a list of numbers the Mathematica way

I have two sorted lists, one list will be called the "fences" and the other the "values" Fences could be: $\{1, 5, 9, 14\}$ Values could be $\{-1, 1, 3, 4, 6, 9, 10, 13, 14, 15\}$ I want to ...
1
vote
4answers
170 views

Add Brackets to a string list

Hello stackexchange community! I have a stringlist with a value and his error for eg: {{"12","1"},{"13","2"}} Now i want to output this as something like this ...
3
votes
4answers
188 views

Pattern matching in nested lists

I'm sure this has been asked before, but I can't find the right combination of search keywords to find it. Apologies. I want to do a ReplaceAll on a list of lists, ...
3
votes
2answers
115 views

How to partition a list according to a nested table structure?

This question is related to this quesion. The goal is to use ParallelMap to map a function to a nested Table to get the ...
-1
votes
1answer
128 views

Efficient Table Generation & NDSolve Error

I'm currently working on solving an SEIR model with data from the CDC. I've created a function to calculate the Square difference for the model and want to create a table of values for the 4 variable ...
3
votes
3answers
138 views

Lists - pairing up

I have two (fairly large) lists of equal length & would like to pair them up. eg - from: a = {{0, 1}, {0, 2}, {0, 3}}; b = {{1, 2}, {1, 3}, {1, 4}}; I would ...
1
vote
3answers
216 views

Matlab-style Find in Mathematica? Value list and Boolean List, how to select values according to the boolean list?

I want to select elements with the true value (Indices list) in the corresponding point to the value list (MCS). Is there anything like Matlab-style Find to get the indices of true values in the ...
1
vote
3answers
98 views

ArrayRules for a ragged list

Let there be a sample list as , l = {a, {{b, c}}, {d, e}, {f}, {{g, {y}, u, h}, {{{{k, j}}}}},k, {{{{q}, {w}, {r}, {x}}}}}; ArrayRules[l] ArrayRules::rect: ...
2
votes
1answer
90 views

Putting values into a grid after iteration process

I'm developing a model of thermodynamic cycle in Mathematica. I wrote several functions, applied them to a list containing starting values and iterated, for the model to converge. ...
6
votes
5answers
237 views

Removing reverse versions of lists from a nested list [duplicate]

I need to remove the reverse versions of lists from list of lists. I.e.: {{1,2},{2,2},{2,1},{a,1,2},{2,1,a}} I need to reduce to ...
12
votes
4answers
366 views

Equivalent Nested Loop Structure

Consider the following examples: ...
3
votes
2answers
119 views

Change all values of a series to positive values

I would like to change all values of a series to positive values. I refer to my previous question, answered in the most part, very elegantly by RunnyKine. However, there remains a slight glitch that ...
3
votes
3answers
93 views

Filling in explicit zeros in a (x,y) list for nonexisting y values for discrete Fourier transform in Mathematica

I have a list of (x,y) values in Mathematica for various discrete x values, as in ...
4
votes
1answer
156 views

List manipulation - various

Update OK, Please forgive the messiness of this, but I am working with something like: ...
0
votes
0answers
27 views

Eliminate some value from a matrix [duplicate]

I have a function that return a table consisting of a 2D points. These points are either {x,y} or {0,0} ...
2
votes
4answers
139 views

Looking for mismatches between two lists

I'm able to do what I need, but it seems like there's always a better way. I have two lists, epiExcel and epiDB. Each has 3 columns and about 2,500 rows. I need to find out if the first 2 columns ...
1
vote
1answer
105 views

Replacement variable in list plot

I would like the replacement: /. {ComplexInfinity -> 0} to be treated as a variable. I am trying to overlay the following list plots: ...
8
votes
1answer
282 views

Two ways of map a function on the list: Which one is faster?

There are 2 ways to make a function listable on the list: Use Map or use SetAttributes. My question is, which one is faster, ...
2
votes
2answers
156 views

How to delete all rows in datafile that contain a string

I'm importing some data from a file. However, the file was created by an unreliable instrument, such that the data looks like this: ...