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

learn more… | top users | synonyms (3)

1
vote
1answer
91 views

ReplacePart inside For loop

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

Syntax for integrating over limits specified by a Table

I wish to use NIntegrate to compute multidimensional integrals. However, I don't want to manually input the limits for the dimensions. I want to store the ...
1
vote
1answer
173 views

Extracting information from list

I have a huge list that looks like this: ...
1
vote
2answers
270 views

Generating a list of rules [closed]

This is my first time asking a question on this forum. I would like to generate a list with a range of numbers and use this list for a function to read from. Ok, now for the good part, it would look ...
1
vote
1answer
128 views

How can I make my code simpler?

I want to find similar letters ...
1
vote
2answers
242 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
4answers
241 views

Combining two lists [duplicate]

Possible Duplicate: How do I obtain an intersection of two or more list of lists conditioned on the first element of each sub-list? I would like to combine two lists. ...
1
vote
2answers
117 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
103 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
308 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
66 views

Need help defining my own rounding function

First of all: I'm a beginner with Mathematica. I'd like to define a function called Rounding which does the following: if for $x = n+a, n \in \mathbb{N}, a\in ...
1
vote
1answer
101 views

How to replace a list with the result list after each iteration [closed]

I have some initial values such as L1 list: L1={10,20,30,40,50}; I want to use the L1 ...
1
vote
3answers
103 views

Gather lists according to another list

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

Selecting every last element of a nested list

I couldn't find a similar question so I decided to ask this one. I have a nested list with many sublists of equal length. To make things easier let's say it's like that: ...
1
vote
1answer
110 views

How to convert the following list into a LaTeX table?

How to convert the output of the following code In[43]:= Func[x_]:=Select[Range[x],Total[IntegerDigits[#]^3]==#&]; Func[1000] which is Out[44]= ...
1
vote
1answer
94 views

How to apply compiled function on list

Compile function output error: How to apply compiled function on list? ...
1
vote
2answers
91 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
93 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: ...
1
vote
2answers
212 views

Swapping elements of list

Say I have a directed graph inputted in the following format in Mathematica: g = {{1, "a", 2}, {2, "b", 1}} I'd like to plot this graph using ...
1
vote
1answer
65 views

Create a new list under conditions from an existing one

I have an external file (data.out) which I read it with Mathematica using data = ReadList["data.out", Number, RecordLists -> True]; This file contains three ...
1
vote
1answer
140 views

Manipulate list from Excel [closed]

I'm trying to import a file from Excel. In fact, I've been trying to do it all day. The problem is that it does not show up in the right format. Where columns in Mathematica represent columns in ...
1
vote
1answer
136 views

Statistical analysis of data-list with recurring x-values

I have a list of data as follows with repeated x-values: ...
1
vote
3answers
138 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
2answers
119 views

Speeding up a simple simulation with random extractions

I wonder if anybody can help, I need a hand with a simple simulation I am writing with Mathematica (I am using version 8). Basically it creates a list (called l) with numbers from 1 to n and a random ...
1
vote
1answer
57 views

PrependTo fails on a Table of Evaluated funtions

My task is something like this: PrependTo[Evaluate[Table[{x, Sin[x]}, {x, 0.1, 2 \[Pi], 0.1}], {0., 1.}]] where I tried also skipping the ...
1
vote
3answers
765 views

How to create functions of arbitrary number of variables? [duplicate]

In the following code what would be the simplest way to generalize it to say some $N_f$ number of $z$ instead of just $z_1$ and $z_2$? ...
1
vote
2answers
311 views

Specifying parts from lists for plotting using Show

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

Combining lists with common elements efficiently [duplicate]

Possible Duplicate: Computing the equivalence classes of the symmetric transitive closure of a relation I am required to process sets consisting of 2-element subsets of integers by ...
1
vote
3answers
246 views

Replace values of a list containing words and numbers

I'm trying to import some data in a .txt file which contains numbers and words. I import a list which consists of four rows of measured data acquired with an oscilloscope, but the acquisition program ...
1
vote
1answer
206 views

How can I permute a multiset?

I have a multiset {1, 3, 3, 1, 2} and would like to randomly permute the classes like so: {2, 1, 1, 2, 3} or {3, 2, 2, 3, 1}, what is the simplest and most efficient way to do this? In reality the ...
1
vote
1answer
151 views

Compile with array operations

When I use the function f with only the Module ...
1
vote
1answer
114 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 ...
1
vote
1answer
93 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 ...
1
vote
2answers
63 views

Sorting lists with elements that are identical [closed]

How can I sort the following list: list={{1498, 1495}, {1498, 1733}, {1553, 1552}, {1552, 1495}, {1733,1776}, {1776, 1553}}; such that the next group contains ...
1
vote
1answer
125 views

ListPlot doesn't shows all points [closed]

I have a table: p1 = Table[(Binomial[2000, k]*StirlingS2[1386, k]*k!)/(2000^1386), {k, 1, 1386, 1}]; I used ListPlot[p1] ...
1
vote
1answer
153 views

Formatting plot of symmetric points differently to asymmetric points

From an array of numbers, I would like to determine (and then colour appropriately) which points are symmetric about a given axis (here, $x = 1/2$), and which are not. For example, form this: ...
1
vote
2answers
97 views

How do I operate on this list elegantly? [duplicate]

calibData = { {200, 10}, {100, 20} } MapAt[N, MapAt[Log10, calibData, {;; , 1}], {;; , 1}] I want to apply a base 10 Log to the first element of each tuple. ...
1
vote
1answer
116 views

Extracting lists from list based on length

I have a list looking like this; ...
1
vote
3answers
166 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
171 views

ListPlot under conditions Part II

I have a data file containing several columns and thousands lines of data. Below I present a small portion of it, in order to express my issue: ...
1
vote
2answers
141 views

Removing pairs that meet a given criterion from a list [duplicate]

Let $(x_{min},x_{max})$ and $(y_{min},y_{max})$ represent lowerbound and upperbound acceptable values for some coordinate $c_i$. Setting $x_{min} = y_{min} = 1$ & $x_{max} = y_{max} = 9$, how ...
1
vote
2answers
148 views

Indicating the probability that a weather datum is above/below some given value on a geographic map

With help of the previous questions here, I am analyzing weather data as daily MeanWindSpeed of some cities with the following code: ...
1
vote
2answers
68 views

How to construct a new list made from a function that operates on two lists

I need to take two lists (each list contains the number of moles of a chemical). I have a function calledFraction that takes the each entry of the list and then calculates the mole fraction of ...
1
vote
1answer
82 views

Calibrating Precision in calculations

As the title says, I encounter an irritating problem which has to do with the accuracy or the precision used in the calculations. To be more specific, I have the following code: ...
1
vote
2answers
147 views

Subtract more than one array using DeleteCases

I need to create an array subtracting two arrays from another array. I know how to subtract one: am = DeleteCases[amp, Alternatives @@ af] I can subtract an ...
1
vote
1answer
123 views

Creating an array eval [closed]

How can I create an one dimensional array (a vector) evaluating a function of two variables? I know how to do it with one variable: Array[f, n, {a, b}] generates a ...
1
vote
1answer
346 views

Using 'Reduce' to solve a set of inequalities, specified by a list

I have a two lists $LHS$ and $RHS$, both of size $n$. I want to solve a system of inequalities of the form: $$LHS[1] \leq RHS[1]$$ $$LHS[2] \leq RHS[2]$$ $$LHS[3] \leq RHS[3]$$ $$\vdots$$ ...
1
vote
2answers
216 views

Symbolically associate vectors and their norms

I am wondering how to handle the following situation: I do have vectors of known dimension that I would like to handle symbolically. I suppose I can do something like ...
1
vote
1answer
389 views

Fastest way to sum pairwise potentials

I've been writing a function to sum a pairwise potential on two lists, i.e. two charged bodies, each containing N >> 1 and ...