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
69 views

Optimization of vector manipulation

I'm trying to implement an upwind scheme for solving transport equation (at first, I work with no right hand side and the simpliest case possible - velocity is constant, initial data is smooth, etc). ...
1
vote
1answer
212 views

How to find the local maximum of a list [duplicate]

I have imported a wav sound that a = Import["sound.wav"] and we know that soundStrength = a[[1]][[1]] is a list of sound ...
2
votes
3answers
166 views

Extracing information from a table

I am new to Mathematica. I have created a table of real numbers. I want to create a new table that contains the set of values of $i$ such that, in my original table, the $i$th entry is greater than ...
2
votes
0answers
136 views

Faster Ways to compute recursive summation

It takes a long time to compute the summation below, and I'd like to know if there are some better ways to compute things faster. I have used $3$ ways to calculate, but they are very unsatisfactory. I ...
11
votes
2answers
199 views

Bug with SparseArray selector in Pick

I have created a notebook with two cells. This is the content of the first: ...
1
vote
1answer
85 views

Matching variables with Subscripts yielding True and False

I am trying match variables with subscripts just returning true or false depending if pattern is matched. My try is to use Cases. However the following does not ...
0
votes
0answers
36 views

Number precision in a list [duplicate]

I have list with elements: ...
5
votes
5answers
334 views

Joining some strings in a list of strings

So, say I have a list of strings, representing lines in a file, like so: ...
0
votes
2answers
101 views

How can I select elements that are true

I have a list of lists. For example, list = {{0,1,0,1,true},{0,0,0,0,false},{0,1,1,1,true},{1,1,1,1,false},{2,2,2,2,false}} I'd like to find all lists that ...
2
votes
2answers
101 views

adding vectors of unequal length [duplicate]

If I have hundreds of vectors of unequal length that I need to sum, what is the cleanest way to do so? So, if I have as input inp={{a,b,c,d},{e,f,g},{h}} I want ...
0
votes
2answers
116 views

Apply Eigenvalues to a list of matrices

I would like to apply Eigenvalues[] to a list of matrices as in the following ...
19
votes
3answers
804 views

How to extract the edge from a set of points

I have an accumulation of points representing a body as you can see in the image below. From this data I want to generate a list of points or a curve, which is the envelope. The first idea was a ...
0
votes
1answer
92 views

Populating an array with outputs of a function [closed]

I have searched, but didn't find much help on my issue. I have an optical physics problem that I'm working on .. ...
2
votes
2answers
161 views

list of vectors with prescribed sum

Let $a\in\mathbb{N}^n$ and $k\in\mathbb{N}\!=\!\{0,1,2,\ldots\}$. How can I efficiently generate the list $$\{(a_1,\ldots,a_k); a_1,\ldots,a_k\!\in\!\mathbb{N}^n\!\setminus\!\{0\}, ...
4
votes
4answers
331 views

Efficient method for Inserting arrays into arrays

This is strongly related to the following Questions: Looking for a way to insert multiple elements into multiple positions simultaneously in a list Building matrices by attaching vectors (columns) ...
1
vote
2answers
72 views

How to switch between a binary number as String and a as a list of digits?

I was trying with String Functions and I viewing any posts and have no results I want to know 1.- From cromo33 = Table[RandomInteger[], {i, 1, 33}] cromo33 ...
3
votes
2answers
240 views

Mapping multiple functions over an array

I am looking for an elegant way to Map multiple functions over an array. My problem looks something like this: Consider a list of functions: ...
0
votes
2answers
141 views

Summarizing SQL Tables

data = Table[SQLSelect[conn, "All", {"col1", "col2"}, SQLColumn["col1"] == n && SQLColumn["col2"] == o], {n, 1, 8}, {o, 21, 30}]; This results in ...
3
votes
3answers
240 views

Data Table Manipulation

Suppose that I have the following ...
2
votes
2answers
196 views

Removing trailing zeros from a list

If I have a list like list1={2334.,342.,0.,0.,2322.,0.,0.,0.,0.,,,,,,}; it's easy to remove to trailing blanks with ...
4
votes
2answers
117 views

Values (or positions) of array row elements within a specified number of positions from target value

I have the need to collect values from the rows of rectangular arrays of arbitrary precision integers, given a target element value and allowed "distance" (positions +/- within the row from found ...
2
votes
4answers
499 views

More elegant way

I read ReplaceOrRemoveInvalidOrMissingData Mathematica documentation, and I tried to apply the same approach to my dataset. I've got two problems, but one is only a style problem! There is one more ...
0
votes
1answer
133 views

Problem ListLinePlot with 2 data sets [closed]

I am trying to plot 2 data sets with ListLinePlot and my problem is that no graph shows up. When I plot a single data set i.e. ListLinePlot[Aluminium] it looks ...
0
votes
3answers
94 views

Function to naming columns

I often import files from excel or csv files and they come in a format like this: ...
2
votes
2answers
258 views

Convert list to sequence

I was just thinking how Tuples was created so , I came up with this, ...
1
vote
2answers
118 views

Factorization of a list with composite integers to a combined list of all prime factors

The following function io[aIn_] produces a list bOut containing ALL the prime factors of an Integer via the standard function FactorInteger[]. My code is: ...
1
vote
2answers
139 views

Manipulating sparse array elements

Suppose I have two sparse arrays ...
6
votes
3answers
189 views

Enumerate the 1-factors (perfect matchings) of $K_n$

Introduction I would like to enumerate the 1-factors, or (near-)perfect matchings, of the complete graph Kn. The adjacency list representation for Kn is basically { (x, y) | 1 ≤ x < y ≤ n }. For ...
0
votes
2answers
104 views

Selecting index position of data from a table that is less than a certain value

I have a table of numbers with a few thousand entries, and I'm trying to find the first index that is less than a particular value. An example of the table I'm working on is as follows: ...
5
votes
2answers
179 views

Join lists of lists with unique id

Sorry for the vague title, but I can't describe my problem properly and shortly. I am maintaining a list of players and their games with the following form: ...
1
vote
1answer
373 views

Collecting lists using Reap/Sow

I have a list like {{a,x},{b,y},{c,x},{d,z},{e,y}} and would like to produce from it a list formed by collecting all top-level elements whose second components are ...
2
votes
1answer
141 views

Speed up Select on large list

I am running this on a very large list, it is important to notice that some times the dates in v occure several times, and I want the selected list to show the same amount. This produces the right ...
0
votes
0answers
57 views

Given a list of pairs, average the second elements of pairs whose first elements match [duplicate]

Say this is my list: mylist={{1,4},{1,6},{1,11},{2,12},{2,14}} I want to do an operation that looks at the first element of each pairs, and for all those that ...
1
vote
2answers
110 views

How to work with lists of functions

I have some lists of interpolated functions and I want to know if there is an easy way to operate with them. A simplified example: ...
4
votes
3answers
370 views

Finding elements from a sparse matrix

I am dealing sparse matrices of very large dimensions. I need to locate the positive and negative elements of the matrices and make lists of their corresponding positions. Of course I can write a ...
6
votes
3answers
247 views

Nested list to graph

The following nested list can be regarded as a representation of a (tree) graph: ...
4
votes
2answers
170 views

How to make sure Table or Do only runs through specific values?

I often need to generate or run through very large numbers of integers (we're talking {i, 1, 10^9} and higher) and want to add certain integers to a list, say ...
0
votes
1answer
88 views

mathematica apply list of functions to the same arguments [closed]

How can I apply list of functions to the same arguments? e.g. ApplyFun[{fun1,fun2,fun3},{arg1,arg2}] I looked here and could not find: ...
9
votes
5answers
538 views

Fast way of finding position of Interval containing an Integer

I have a large list (about 2.2 million) of pairs of integers. Each pair defines an Interval[{}]. Given some integer x, I need to ...
2
votes
1answer
52 views

Conditional clustering of elements

I have a long list like: ...
2
votes
1answer
84 views

MapThread over a nested list

This may be a simple question. Please close it if it is already answered. I have a nested list kr = {{35, 32, 27, 20}, {36, 33, 28, 21}, {37, 34, 29, 22}} I ...
0
votes
2answers
48 views

Filter through list and lump data [duplicate]

I have a very large data set (around 3000) that looks like: ...
1
vote
1answer
123 views

Exporting a list as RawData or Data

My problem is quite simple yet I do not seem to figure out the solution to it. I am simply trying to export a list in Mathematica, actually a list of lists of lists etc, something like ...
0
votes
1answer
91 views

confusion about the use of MapThread and out product

To help distinguish the various dimensions, I have a model which outputs a vector in a series of time intervals, I then construct a list of these models. Next, I would like to compute the outer ...
10
votes
1answer
211 views

Drop selection of columns from a ragged array

I have an application where I need to drop some arbitrary list of columns from a ragged array (where of course the shortest array rows have at least all the specified columns). E.g., given a ragged ...
0
votes
1answer
58 views

Importing and manipulating data in HDF format

I have two matrices A1 and A2 in HDF format. I use the following code to import them. ...
2
votes
2answers
182 views

Plotting data in a weird format

I have a lot of data on the following form: data = {{param1,param2,param3,param4,{{x1,y1},{x2,y2},...,{xn,yn}}},...} The first variables in each sublist are ...
0
votes
2answers
54 views

Sorting non-numerical lists [closed]

The Sort function will by default sort from lowest to highest. In[1]:= Sort[{3, 1, 4}] Out[1]= {1, 3, 4} However, if the list ...
1
vote
1answer
144 views

Unexpected output from oddSublists [duplicate]

I have just bought Mathematica and I'm in the process of plowing through Shifrin's great book. On page 74 the function oddSublists doesn't give me the expected ...
0
votes
1answer
156 views

How to format the data in a table to have only numbers

This question is in continuation of my earlier query, how to store output of a function in a table for future use. I am able to store the output of my function in a table, however the table consists ...