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

learn more… | top users | synonyms (5)

1
vote
2answers
73 views

Element-wise join multiple lists [closed]

The following question is related to: Elementwise join I have the following code: ...
1
vote
1answer
93 views

Pattern matching list of elements with different heads

I have a function, which I want to accept only a list of kind of elements belonging to a group. The task comes down to finding an elegant pattern suitable for easy to read function prototype. As an ...
1
vote
1answer
81 views

Position vs Part [closed]

What's the difference between Part and Position? How can I "move" from the form used by Part to that of Position (and vicerversa?) Thanks!
1
vote
2answers
166 views

Evaluate a list

I have a function $f(x_1,\cdots,x_n)$ that takes $n$ arguments, and I would like to evaluate it using a list of lists $\lbrace\lbrace x_1,\cdots,x_n \rbrace,\cdots,\lbrace x_1',\cdots,x_n' ...
1
vote
2answers
70 views

Incomplete Parallel Mapping

I am still struggling on how to nicely handle list operations in Mathematica, and perform simultaneously parallel computation. We consider a tab of the form ...
1
vote
3answers
189 views

A rule replacement problem: list -> list

Suppose I have a vector function f[x_] := {x[[1]]^2 - x[[2]]^2, Sin[x[[1]]] + Cos[x[[2]]]}; Then I want to make a list of gradients at some values: ...
1
vote
4answers
183 views

Need an efficient way to do this list manipulation

Lets say i have two lists with me as given below: l1 = {4, 6, 8, 9, 10, 12}; l2 = {2, 3, 4, 5, 6, 7}; Now i have a function S2P(details irrelevant) which takes ...
1
vote
2answers
291 views

From a list of (x,y) pairs, generate a new list of (x,ymean) pairs, where ymean is the average of all y's with the same x in the original list [duplicate]

This seems like the sort of thing where Mathematica can give a very simple solution. I have a list of points {x,y}: ...
1
vote
3answers
193 views

How do I select only those lists whose elements are all above a certain number?

I'm essentially doing coin flips, using RandomReal to populate a bunch of lists, each with 8 elements. I then want to select only those lists for which all elements are greater than a certain number, ...
1
vote
3answers
200 views

Gather lists according to another list

I have a first list of pairs like this one: ...
1
vote
1answer
328 views

GatherBy and two conditions

I have a list of 4 dim points, given by ...
1
vote
1answer
900 views

How can you convert a matrix back into a list of lists?

It is very simple in Mathematica to convert a list of lists into a matrix: all you need to do is apply the //MatrixForm function to it and voila. Is it possible ...
1
vote
1answer
144 views

A list containing zero elements

I have a list containing zero and nonzero elements. How can I throw away zero elements and just keep non zero ones.
1
vote
2answers
149 views

Result of NIntegrate ploting to list

I've been working on a project where I need to make two Plots. Those plots are of the form: ...
1
vote
2answers
229 views

How to create automatically some matrices for symbolic manipulation?

I want to create in an automatic way some matrices to do symbolic calculations with them. They look like these: $$ \left( \begin{array}{cccc} a & 0 & b & 0 \\ 0 & 1 & 0 & 0 ...
1
vote
2answers
172 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
442 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
2answers
101 views

Missing something in my input for CountryData dependencies

I'm trying to find (a)which countries have dependencies (b)and a list of countries that consider themselves dependencies (c)and a list of countries that don't consider themselves dependencies. ...
1
vote
4answers
158 views

Can I combine two FoldList into one?

I want get something like this: {{x, x}, {g[x, 1], f[x, 1]}, {g[g[x, 1], 2], f[f[x, 1], 2]}, {g[g[g[x, 1], 2], 3], f[f[f[x, 1], 2], 3]}} one way is ...
1
vote
3answers
361 views

Creating overlapped block matrices

I'm doing an FEM assignment using Mathematica. (EK1 = {{a11, a12}, {a21, a22}}) // MatrixForm (EK2 = {{b22, b23}, {b32, b33}}) // MatrixForm I don't know how ...
1
vote
1answer
153 views

Computing a mean of median list of points

Given a array of lists with the same number of here N = 10 elements: ...
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 ...
1
vote
3answers
213 views

How can I create a new tables out of a table and plot it

I have the following problem. I have a table, call it m, which is labelled by 3 indices (say i,j,k), each of them running from 1 up to 100. I would like to be able to construct a new table which would ...
1
vote
1answer
215 views

ReplacePart inside For loop

I am trying to replace the last column of the following expression (mat) by doing ...
1
vote
1answer
136 views

How can I make my code simpler?

I want to find similar letters ...
1
vote
2answers
323 views

How to generate patterns by a list of integers

I have a list of integers {3,4,2,2}. This list will give patterns {x_,_,y_,y_,_,_,z_,z_,w_,w_,x_} and ...
1
vote
2answers
571 views

Specifying parts from lists for plotting using Show

I have the following data: ...
1
vote
2answers
148 views

Return a string from a vector containing a string and a number

I currently have a List of the form, {{String_1, 8.}, {String_2, `101.}, {String_3, 37.}, ..., {String_n, 28.}} Along with another list, ...
1
vote
1answer
112 views

How can I manipulate with elements inside sublists if sublists of different lenght?

I have some kind of output like this: {{1, 5}, {1, 13}, {1, 5, 25}}. I would like to be able to enter in each sublist and make sums of every two elements in sublists, for example my desired output ...
1
vote
2answers
446 views

Operations on sets of sets [duplicate]

Possible Duplicate: How can I remove B -> A from a list if A -> B is in the list? Delete duplicate elements from list Pattern matching deletion of list items How do I delete the ...
1
vote
1answer
33 views

Reverse element in nested list [on hold]

Suppose I have a list as the following: list={{1,9},{7,0},{8,6}....} How can I reverse the element in such way that the output would be the following: ...
1
vote
3answers
88 views

Polar histogram and bins

I have a list of polar coordinate points: list = Transpose[Join[RandomReal[{1, 60}, {1, 100}], RandomReal[{0, 2 Pi}, {1, 100}]]] I need to divide the ...
1
vote
1answer
87 views

Continued fraction with different numerators [duplicate]

In Mathematica, is it possible to form the continued fraction of the following formula? $$ f = a_1+\cfrac{b_1}{a_1+a_2+\cfrac{b_2}{a_2+a_3+\cfrac{b_3}{a_3+a_4+\cfrac{b_4}{a_4+...}}}} $$
1
vote
2answers
84 views

Change function acting on sum to function acting on each object individually

Given a function like Conjugate[] acting on a sum, how I can change an expression like ...
1
vote
1answer
85 views

Find intersections points with axes

Let's create some points corresponding to a simple closed curve ...
1
vote
2answers
86 views

Pick the maximum element of each nested list [closed]

Suppose that I have a list with nested lists, where each nested list contain entries consisting in 3 columns: ...
1
vote
2answers
80 views

3d Table to 2d table

I have generated a Table in 3 dimensions, for two variables x, y. ...
1
vote
2answers
66 views

Add elements to the maximum values of a list

Hi i have a list of n elements and i want to know the 30 maxim values of list without changing his order. And suppose that i have a second list with n elements and i want to add this elements to the ...
1
vote
2answers
74 views

Convert a list of lists of rules to a list of values [closed]

I have a list of the following form: thisVeryExcitingList={{x->1},{x->2},{x->3}} I would like to convert it to the form ...
1
vote
5answers
149 views

Select using MemberQ

I want to make a selection on this list ...
1
vote
4answers
97 views

GatherBy output with given Shape

I would like to group items in a binary list according to some property like in the following simple example. ...
1
vote
2answers
169 views

Create a table of Mean Values and Standard Deviations from data list

I need to create a table of the Mean Values and Standard Deviations of 18 columns of data from a table. I know how to compute the Mean and Standard Deviation for the different columns, but am unsure ...
1
vote
1answer
73 views

Incompatibility of Append and NumberForm? [closed]

Consider the code list = {.12, .23, .34}; Append[Round[list, .1], 10] Append[NumberForm[list, 1], 10] The use of Round returns the expected result ...
1
vote
1answer
51 views

Collecting specific Lists of data in coordinate form

Note: This might be trivial for many of the users but i am new to mathematica so i don't know!!! Question: Suppose i have three list of data as follows: ...
1
vote
4answers
212 views

How to check if all the members of list lies in specific range

I have a list the form: ...
1
vote
2answers
169 views

Complex numbers from two arrays with Real and Imaginary parts

I have two arrays, containing the real and imaginary parts of a list of complex numbers. Re = {{Re_number1},{Re_number2},...} Im = {Im_number1},{Im_number2},...} ...
1
vote
3answers
68 views

Delete permutations of subtables in a table [closed]

I've got a table of tables: $A=\{\{a,b\},\{b,a\},...,\{a,b,c,d,e\},\{e,d,c,a,b\},...\}$. How do I do to remove backward duplicates, or more generally permutations of duplicates in the table? For ...
1
vote
2answers
108 views

How to make function accept list of rules as an argument?

Considering the list of rules: r= {"a" -> "1", "b" -> "2", "c" -> 3, d -> 231, "e" -> 1.25}; I want to have a function ...
1
vote
4answers
131 views

Find all disjoint subsets of equal length

Suppose that $A$ is a list with $n$ elements where $n$ is even. I want to write a function that returns all pairs $(A_1,A_2)$ where the sets $A_1$ and $A_2$ each have length $\frac{n}{2}$, $A_1 \cap ...
1
vote
2answers
130 views

Evaluate list of functions at a certain point

I have a list of functions (actually they are derivatives) of the type: {D[g[x,y],x],D[g[x,y],y]} I would like to evaluate all of these functions at a point, ...