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

learn more… | top users | synonyms (3)

0
votes
0answers
46 views

Fourier Transformation of a List

As we know the FourierTransform goes a function of t ,for example, f[t] to ...
8
votes
3answers
164 views

Truncating a list once all members of a set have appeared?

Consider if you would the case where we have some list of elements: list0 = {54, 4, 7, 9, 3, 54, 4, 20, 2, 456, 2, 3}; And we have some target list: ...
1
vote
1answer
28 views

Nested list element at position specified by a list

I'm trying to avoid constructions like Y[[X[[1]], X[[2]], X[[3]]]]. That is we have a nested list (Y) of depth $n$ and another ...
0
votes
1answer
123 views

How do I plot results of complicated calculations in Mathematica?

I am new to Mathematica and am struggling with making plots of how features of solutions vary with parameters. For example, I can find the eigenvalues and zeroes of a Sturm Liouville problem (showing ...
1
vote
1answer
57 views

Shifting Columns in an Array Efficiently

I am trying to find a more efficient way to shift the columns of the partitions of an array according to a defined slope and fill in the shifted regions with zeros I have done it below but, I know it ...
2
votes
0answers
54 views

pattern matching and applying a function, not working as expected [duplicate]

Consider the following code G[x, y] /. a_[b__] -> Total[a @@@ Permutations[List[b]]] I expect it to give G[x, y]+G[y,x] ...
0
votes
1answer
55 views

ListPicker delayed output

I'm trying to make a wrapper for ListPicker that delays updating the list unless Ctrl or Shift is released. The aim is to allow nested ...
1
vote
2answers
115 views

GPA calculation from a set of randomly generated marks obtained

So, this is a homework question posed by my teacher: "A student has 10 courses. Find the ceiling value of the obtained marks and corresponding grade according to the following data Print the result ...
1
vote
2answers
65 views

how to get continuation of square matrices with periodic diagonal band automatically?

I want write a function that can automatically analyze any square matrices with periodic band diagonals and give continuations of them. But I can't figure out an elegant way to do this. Suppose we ...
3
votes
1answer
134 views

Function that returns the second argument of Reap

I'm trying to create a function that returns only the second argument of Reap. Here's my naive guess of how it would go : Reap2[x_]:= Flatten[Reap[x][[2]],1] ...
3
votes
3answers
122 views

Finding largest Range in a list

In a list of positive integers, I would like to find the largest n such that Range[n] is a subset of the list. So for example ...
6
votes
3answers
313 views

Better answer to Santa's riddle about sum of a number's divisors?

I was hoping to find an elegant solution to this riddle, using only a line or two of Mathematica: Santa Claus was telling one of his elves: "If I multiply the age of three of my reindeer, I get ...
1
vote
3answers
66 views

GatherBy based on condition imposed on index variable

Excuse me. This might be user specific question but I need your help. I have an indexed data, where positive integers are used for indexing data. I am trying to group data putting condition on index ...
1
vote
0answers
38 views

Problem with ParallelTable in using externaly defined iterator [closed]

In order to reduce my computation time, I'm making some tests with parallel computation, especially with ParallelTable. Here is a simple code : ...
5
votes
2answers
107 views

TemporalData, RandomFunction, Loops: Extracting data from TemporalData sets?

I'm doing a finance project for my differential equations class to explore stochastic processes. I'm exploring IRA retirement funds. From the project write-up: Standing assumption: at time of ...
2
votes
2answers
90 views

Why is Nearest not giving me expected result

I have the following list: numbers={0.,0.6,0.8,1.,1.2,1.4,1.8} Then I calculate the midpoints: ...
0
votes
0answers
40 views

Regarding Cycles and Lists of Functions

So, I'm trying to determine the Normal Matrix of a Least Squares Aproximation; I have a basis constituted by 8 functions f1,f2...f8; I have 9 points which constitute Datax = {x1,x2...x9} Now, I ...
0
votes
1answer
72 views

for loop and list

I'm new to Mathematica. I want to built a function like that; ...
2
votes
1answer
99 views

Request for Explanation in case of Replacement not working

The 2 code snippets work on a matrix ABg with 22 rows and two columns containing Strings. Some entries in column 2 are List { } to be recognized by the first Character "{". In the list some items must ...
1
vote
1answer
51 views
1
vote
0answers
41 views

Creating a List with Lists as entries [closed]

I'm trying to create a list A which contains 8 same elements. Each of the elements look like {0, 0, 0, 0}. I was able to do it ...
1
vote
3answers
47 views

While subpartitioning the elements in list using GatherBy, can I corresponding subpartition the elements of an unrelated list?

If we have a list like the following: list1 = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; And we use GatherBy to subpartition is according to a test function ...
1
vote
2answers
38 views

Subpartitioning elements of a list based on some h[ri] == h[rj] test

If we have a list of elements: list = {r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12}; I'd like to further partition the elements into sets where, for some ...
2
votes
3answers
57 views
0
votes
1answer
58 views

How to add an extra column to a current matrix (list)? [duplicate]

a = {{-800, 1712}, {-801, 1713}, {-806, 1832}} TableForm[a] b = a[[All, 2]] - Min[a[[All, 2]]] How do I make a new matrix (list) whic looks like this ...
1
vote
2answers
42 views

Creating a list of triangle-square numbers up to n_

I have to, for a class, create a function that gives you the triangular-square numbers up to n. That said, here's the code I have: ...
0
votes
4answers
79 views

how can one select elements from a list that are satisfied a criteria which need to compare with other elements in the list?

For example: I want to select elements from a list {1,4,3,2,5} that are bigger than its previous element. {4,5} satisfies the criteria: 4 is greater than 1 and 5 is greater than 2(Ignore the first ...
2
votes
4answers
112 views

Use a categorical argument to add one layer of list structure

Consider the following nested list x = {{1,2,a}, {3,4,a}, {8,11,b}, {12,3,a}, {4,3,b}, {3,2,c}} I want to use the categorical variable ...
2
votes
2answers
86 views

Insert at specific resulting positions in multidimensional list?

I have an initial "multidimensional" list (that is, a list that is not a vector): list0 = {{1},{2,3,4},{3,4},{5}}; and I want to insert elements ...
1
vote
2answers
71 views

Insert at specific resulting positions?

I have an initial list: list0 = {1,2,3,4,5}; and I want to insert {a,x} at specific positions ...
0
votes
1answer
49 views

Plotting data from specific column

I have data like this: 1406998993.147 73 TCP_MISS/200 22284, 1406998993.158 109 TCP_MISS/200 83827, 1406998993.197 111 TCP_MISS/200 57020, If I want to plot the column 1 and ...
1
vote
1answer
86 views

Constructing new lists using Table

I tried to modify an old notebook to show a spreadsheet style output in a table. I am not getting any errors when it runs, so I think the data I am gathering and the new variables I added, ...
0
votes
1answer
44 views

Deleting list elements at a certain level

I have a large list of 3 by 3 matrices such that the dimensions of the list for an example 100 matrices would be: {100,3,3} I have written a function that locates all the matrices I do not want and ...
0
votes
1answer
43 views

Simple arithmetic operations on elements of a list [duplicate]

How can I shift the first element of a list by 148.38 and the second element by -38.45? The data ...
2
votes
1answer
57 views

second part of a list with something like BinLists

I have a list that looks like this testList = Transpose@Table[{RandomInteger[{0, 100}], RandomReal[]}, {100}]; i.e. basically two lists in one. Using BinLists ...
2
votes
4answers
149 views

How to remove hours, minutes, seconds from list

How to remove 0 that represent hours, minutes, and seconds from a date list say a ...
2
votes
1answer
33 views

In each sublist, replace the value in the right part by the value in the left part

Consider the following nested list {{a,1/x},{b,2x},{c,Sqrt[x]},{d,1-1/x}} I'd like to come up with the same list where the variable $x$ is systematically ...
4
votes
5answers
133 views

New nested list from three lists

I have three lists. x = {a,b,c,d} y = {A,B,C} z = {{1,2,3},{4,5,6},{7,8,9},{10,11,12}} and I wish to construct the following list out of these three lists ...
1
vote
1answer
91 views

Why doesn't Thread work in this case?

The following function is supposed to pick the element of the list with highest weight, i.e., with Thread [f[{{a,1},{b,2}}]] it should make the variables ...
3
votes
3answers
124 views

How to pick the maximum of a list? Improving efficiency

I need to find the element of a list, with the highest weight. Example: ...
1
vote
1answer
46 views

List Manipulation and Removing Cases

I've imported a large data set, manually removing headers in the .rtf file where it originates. However, when I import this data, I receive this output: ...
0
votes
1answer
47 views

Position of elements in a list satisfying some criteria - Understanding the syntax [closed]

From this post: if one wants to know the position of the elements of a list that satisfy some criteria, (s)he can do something like that: ...
3
votes
3answers
171 views

Trouble with Position[]

I am in trouble with Position, Although my example works as expected it throws a warning. Position[{{a,b},{a,c},{a,b}}, _?(#[[2]]==b&), {1}] During ...
0
votes
1answer
58 views

How to use Hold on a variable defined as a graph

I'm working on doing operations on different graphs and getting their probability node degree distributions using a simple algorithm. If I have many defined graphs, for example: ...
1
vote
1answer
48 views

How to make a table of successive values

I want a list, where each entry is of the form {x,y}. I want x to go from $-\pi / 2$ all the way up to $\pi/2$. I also want ...
0
votes
1answer
41 views

Elegant ways of solving this file batching task

There are a batch of data files in a folder (dir = "D:\\Documents\\datadir"), each of which consists of a list of data items, one per line. Each data item is a pair ...
1
vote
1answer
31 views

Applying MeanFilter to a large Nested Array [closed]

I have a large nested array. Let's generalize it to this: Data = {{a1,a2,},{b1,b2},{c1,c2}} I need to make a new array where ...
4
votes
4answers
142 views

Partition list into a given number of sub-lists

I'm having quite a hard time with the following. I would like to partition a list into a list of sub-lists, in such a way that the number n of sub-lists is fixed. ...
2
votes
3answers
81 views

Comparing two lists lexically

I have two lists of integers a and b of equal length, and I would like to define a>b as ...