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

learn more… | top users | synonyms (3)

3
votes
1answer
120 views

Assigning Sequence to Part of a SparseArray (bug?)

Part ▪ You can make an assignment like t[[spec]]=value to modify any part or sequence of parts in an expression. ▪ If ...
3
votes
2answers
286 views

Find local maximum in 3D list

I have a set of data of the kind {{$x_i$, $y_i$, $z_i$}, ...} at randomly chosen points $x_i, y_i$. The $z_i$ are supposed to be a smooth function of the $x_i$ and $y_i$. Unfortunately they turn out ...
4
votes
0answers
182 views

Strange behavior of undocumented RawArray and ArrayObject expressions

I discovered several strange results and inconsistencies while trying to understand what undocumented RawArray and ArrayObject ...
1
vote
1answer
287 views

Measuring the area of non analytical regions in a plot [duplicate]

As the title says, I want to measure the area of different closed regions in a plot. Let me be more specific by giving a characteristic example. In the following figure, we observe that inside the ...
2
votes
1answer
150 views

Coarse-graining and/or sorting of a list of arbitrary triades {x,y,z} in the (x,y) plane [duplicate]

In general my question is related to an approach to make an interpolation of a data which is not on a regular mesh. Another aspect of this question has already been discussed after my question ...
12
votes
6answers
532 views

Sort+Union on a list

Probably this is too trivial question for this forum but for some reason I am not getting it on my Mathematica 7 so far. I have a list ...
9
votes
6answers
403 views

Performing Computations on Sets

I would like to find a permutation of $\quad S=\{\frac{1}{10}, \frac{1}{2}, \frac{4}{7}, \frac{3}{5}, \frac{2}{3} \}\quad$ that maximizes the sum of theses elements raised to unique powers: ...
0
votes
0answers
107 views

How can I revise my program to avoid “No more memory available”? [duplicate]

I have a program for calculating a type of list. ...
1
vote
1answer
113 views

Forming product of function of prime factors

Given a list of numbers each containing 2 prime factors, I wish to make a list of the products of the logs of each factor. For example, given L = {4,6,9}, I would like to form P = ...
1
vote
1answer
278 views

Find elements of a list which are empty

Sorry for the most basic of questions. How would I find the positions of a list of elements which are empty, for example I have the list ...
1
vote
1answer
255 views

Simpson's rule with ListConvolve or ListCorrelate

I have a function that's represented as a long list of values that I want to integrate. I can do it procedurally with Simpson's rule. ListConvolve generally runs faster then procedural code, so i ...
3
votes
1answer
154 views

Little problem with Through

list = Partition[Range[20], 5, 5, 1, {}] {{1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}, {16, 17, 18, 19, 20}} ...
1
vote
1answer
163 views

Equating two lists, element by element

Say you have two lists: listA = {a, b, c} listB = {d, e, f} How would you produce a listC that equates each of the two's ...
1
vote
0answers
92 views

Optimized subset algorithm implementation

I was reading a paper from Mathematica Journal.It mentions a code for calculating subsets. ...
5
votes
3answers
497 views

How do I find the intersection of a closed 3D curve given by numerical data with a specified plane?

I have a list of 3D data points which form a closed curve. My own data can't be easily generated analytically, but the qualitative behaviour is well represented by a parametric curve families such as ...
1
vote
0answers
142 views

Why doesn't ParallelMap improve the performance of FoldList?

This question arose during my analysis of the following problem: filling gaps. (The code used here is Simon Woods's work.) FoldList seems to not cooperate with ...
2
votes
4answers
207 views

How to improve the quality of the ListPlot output

I need to plot massive data stored in external ASCII files. Below is the Mathematica code I use for this job: ...
12
votes
10answers
608 views

How can I generate a nested array like this one?

Well, this is how the array looks like: I came up with this code: n = 10; Nest[ArrayPad[#, 1, 1 - #[[1, 1]]] &, {{1}}, n] /. {1 -> "*"} Any better ...
3
votes
2answers
152 views

Modify all the second elements of every pair in a list of pairs

I have a list in the form {{a, 1}, {b, 2}, {c, 3}}. Let's say I want to operate a transformation on all the second elements of each sublist, but this transformation is a function of them all ...
16
votes
6answers
569 views

How do I replace a missing value in a column with the value immediately above throughout a table?

I have a large table (7000 rows × 17 columns) of terse textual data. In many of the columns, empty entries have been replaced with "." as a marker. Working from the top of the columns downward, I want ...
14
votes
7answers
626 views

A function that accepts a pair or a list of pairs

Probably a duplicate, but it's not easy to search on "lists". I have a function that accepts a list of lists, say {{a1, b1}, {a2, b2}, {a3, b3}} and performs some ...
8
votes
5answers
272 views

Wrapping a function in count

I am working through the Programming Paradigms via Mathematica (A First Course) and am attempting to answer the following: Use recursion to count how many times the argument can have its square ...
20
votes
15answers
1k views

How do I extract the middle element(s) of a given list?

How do I extract the middle element(s) of a given list? Here is some code that works, but seems a little too long: ...
5
votes
1answer
168 views

What is the fastest way to maintain a large set of expressions?

In my algorithm I need to maintain a set (an unordered list of distinct elements) of expressions supporting two operations: Test an expression for membership in the set Adding a new expression to ...
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. ...
0
votes
1answer
106 views

Displaying Values of Fuction at end of Period by Grid

My intention is to place the values of two function into a small box within my chart. To be more precise I have two vectors. A meanvector which shows the average value of all simulated stochastic ...
1
vote
2answers
279 views

Scatterplots for subsets of multivariate data [Updated]

Update/Re-write There has been a lot of ambiguity over what i'm am trying to do with this question so I have decided to give it a full rewrite. I'm really sorry for the confusion. If you want to see ...
8
votes
4answers
382 views

Partitioning a list by recursion (Programming Paradigms via Mathematica (A First Course))

I am working through the course Programming Paradigms via Mathematica. One of the homework exercises for the section Recursion I: Passing the Buck is as follows: Use recursion to partition a ...
5
votes
4answers
464 views

Combining the second elements of a set of ordered pairs based on their first element [duplicate]

I have a large set of ordered pairs and I am trying to add the second elements together for any group of pairs that has the same first element. For example my data looks like: ...
0
votes
1answer
123 views

Stopping- threshold and stopping- time of stochastic processes.

Rod Lm helped me to generate the following code, which I want to extend a little bit. So my intention is to use the threshold (the green line) as boundary in the following way: as soon as the process ...
1
vote
1answer
124 views

WeatherData acquirement in ListStreamPlot

I am trying to show the wind streams in a geographic area as following code for a range of time.Even if it works for realtime data but it doesn't work for range of time.I am filtering and also taking ...
0
votes
1answer
191 views

Brownian Motion with stopping threshold

I just want to generate one stochastic process, whereas I want to be able to manipulate the start value and the volatility. Furthermore, the process should stop when it reaches 5 However, as soon as ...
0
votes
1answer
83 views

order items of a table

I am trying to change order of a table. ...
1
vote
2answers
111 views

Select elements in a list when the firsts two items are the same (no matter order) and its third element is lower

I'm trying to solve a heuristic search in Mathematica 9. I get a list of succesor nodes called open with two nodes and a heuristic value, e.g., ...
1
vote
1answer
88 views

Expand list of {{t1,x1},…} with new set of t's

I have a list of the form data={{t1,x1}, {t2,x2},...} and a list newt = {nt1,nt2,...} and I want to expand ...
0
votes
1answer
203 views

ListVectorPlot3D

I try to plot a 3D Vector plot. All Vectors start at (0,0,0) and point in directions given in spherical coordinates: ...
0
votes
1answer
149 views

Problem with importing format of data from Excel?

I am trying to import data from Excel. It is located in a single column of the Excel file but each cell contains a comma separated pair of two values as a,b. When I am importing them I have this ...
2
votes
3answers
266 views

Introduction of straight Line into Manipulate function

I just want to implement a line within my chart that starts from time point 0 to time point T and whose y-coordinates can be manipulated, which in my case is represented by D. I tried to implement a ...
0
votes
1answer
81 views

Sublist inside simple list

I have a doubt to confirm. Let there is a list f = {{l}, {c}, {d}, {e}, {1, 2, 3}, {3, 4, 5}} And I expect it to be traversed as a normal list which I can do ...
4
votes
2answers
96 views

Specific rearrangement of elements in list

I have an $n\times n$ matrix G with elements g[i,j] that I construct with ...
0
votes
1answer
90 views

Making a list from equations

I want to make a list (efficiently) which is the set of lattice solutions of the following equations (depends on $k$): $x_0\geq 0$ and $x_i\in [0,4k]$ for $i=1,\ldots,4$ satisfies $x_0+x_3\leq k+3$, ...
0
votes
1answer
149 views

Problem with ListContourPlot feeding data format and WeatherData

With following code I am trying to show the mean wind speed patterns for a few geographic locations. ...
1
vote
2answers
425 views

How to find the position of non consecutive numbers?

Given a sorted table, how can I find the position of non consecutive numbers in the first column of the table? ...
3
votes
1answer
186 views

Removing sublists containing elements from another list's sublist

Let there be two lists that have sublists: a[] = {{1, 2}, {1, 2, 3}, {2, 3, 4, 4}, {3, 4, 4, 5}} and ...
4
votes
3answers
185 views

Renaming and indexing list of rules

I have a list of rules that represents a list of parameters to be applied to a circuit model (Wolfram SystemModeler model): ...
7
votes
2answers
241 views

Programatically adding/retaining comments within a nested list

Is it possible to convert the following list of strings to computable numbers with the comments preserved? ...
5
votes
6answers
229 views

Selective thinning of string elements in nested lists

I have a nested list similar to this example list (but much bigger and more messy): ...
0
votes
1answer
527 views

How to calculate the area of a listplot [duplicate]

I need to calculate the area enclosed in a two-dimensional listplot and following an answer to a similar question I tried this way: ...
2
votes
1answer
308 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 ...
1
vote
3answers
132 views

How to convert a spaceless data into tab delimited

I have a data set in form of:(this is just an example) 1324501020 3241030205 4332020134 the data are stored in a text file (e.g. data.txt) but I need to convert ...