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

learn more… | top users | synonyms (3)

2
votes
1answer
110 views

Deleting selected rows from data table [closed]

I'm an intermediate Mathematica user and the select function presented on Data Table Manipulation in Mathematica: Step 2 was very useful in helping me manipulate a 36Mb data file - 13 columns and 180k ...
2
votes
1answer
44 views

Complement for a Matrix

In a matrix, there are some non-zero elements same as: aA= Also, there is a list such as: list = {a, b, c, d, e, f, g, ii, jj, kk}; I want to access to ...
2
votes
1answer
172 views

Is there a better way to create my rotational-symmetric (180 degrees) rectangles?

I have created a simple way to create rotational-symmetric (180 degrees) rectangles, but my stuffit function bothers me. No matter what I tried, I couldn't get it ...
2
votes
1answer
89 views

Explore a nested list

This question is similar to Numbering nested list according with Depth (or Level) I have a list like ...
2
votes
2answers
127 views

Generating an editable table that can be used as input

Say I have a number $n_{max}$. I want a command to generate a table like 1 1 2 2 3 3 4 4 ... nmax nmax where the second column is editable, and this table can be ...
2
votes
2answers
53 views

Specifying an array with a specific number of copies of two elements

To specify an array of length L in Mathematica, where each entry is someElement, I'm accustomed to writing: ...
2
votes
1answer
69 views

Convert Integer to Numeric with Replacement rules

I have a long list of triples, each looking something like {AGO, 1988, 2345.23}. Some of these, however, have an integer in the third spot, like this: ...
2
votes
2answers
144 views

How to delete all rows in datafile that contain a string

I'm importing some data from a file. However, the file was created by an unreliable instrument, such that the data looks like this: ...
2
votes
1answer
362 views

Newton-Raphson Method and the Van der Waal Equation Coding question

So I need to find Specific Volumes using the Newton Method from the Van der Waal equation over a change of constant Temperature but variant Pressure. I have been able to make a list of however many ...
2
votes
1answer
265 views

Extracting a range of data from a table

I have text file with data in 2 columns. I have imported it using the following line c = Import["ab", "Table"]; This text file has a large amount of data, and I ...
2
votes
1answer
138 views

How to compute a discrete histogram of a list [duplicate]

I'm trying to compute the discrete histogram of a set of values. By histogram I mean the absolute frequency a value appears on the dataset, by discrete I mean the values are from a discrete set, e.g. ...
2
votes
1answer
123 views

Match a sequence of integers

I would to match a pattern p1 = 0,0,1,0,0 to the elements in listA. The elements are a boolean sequence that may look like this ...
2
votes
1answer
109 views

How to make a list/matrix out of an expression?

I would like to make a matrix out out of the following expression: $$ (\Omega^2 (2 d\theta^2 + d\phi^2 - d\phi^2 \cos(2 \theta) \coth(\chi)^2) + (2 d\Omega^2 + (2 d\theta^2 + d\phi^2 - 2 ...
2
votes
1answer
126 views

Plot several lines with different starting points on the x-axis

First of all, I would like to apologize in advance if I don't use the correct terms or if I express myself unclear but I just started to work with Mathematica. I'm simulating electricity prices and ...
2
votes
1answer
686 views

How to solve equations self-consistently

I want to solve the following equation self-consistently. So, H.u = e.u {{1, d}, {d, 1}}.{u1, u2} = e.{u1, u2} I guess an initial value for ...
2
votes
1answer
148 views

writing a function using multiple variables

I am fairly new to Mathematica and am trying to write a function for the equation: xx = [x/(Sqrt[h^2 + d^2 + y^2]))*(Sqrt[h^2 + (d + yy)^2]) where h, d are known ...
2
votes
1answer
176 views

List of different values which have to be formatted differently

I have a large list of values which – for presentation in my LaTeX document – I need to format. For instance: I have calculated growth rates which I now would like to have formatted in the form of: ...
2
votes
4answers
109 views

Backsubstituting solution into FindRoot and Plot

I want to find roots from a transcendental equation using FindRoot as a function of a real parameter and then plot the solutions vs. the parameter. The following commands work perfectly: ...
2
votes
2answers
58 views

Ordered indices of a multiple product or sum

Given a summation like $$\sum_{1 \leq i_1 < i_2 < \dotsc < i_k \leq n} f(i_1, i_2, \dotsc , i_k)$$ how can the lists of indices be enumerated? For example, if $n=4$ then the possible lists ...
2
votes
1answer
148 views

Finding the optimal teams ranking based on the table of match results

My original question was this: So my task is to score all the possible rankings of the 14 SEC football teams and find the best one, using who won in head-to-head games as the sole criterion ...
2
votes
1answer
86 views

Recursion when randomizing elements in a list

I want to randomize certain elements of a list; Since the code list = {a, b, c, d, e, f, g}; list[[{1, 3, 5}]] = RandomSample@list[[{1, 3, 5}]]; list works fine, ...
2
votes
1answer
178 views

What is an elegant way to aggregate two cash flows

When modeling a swap contract a common operation is to sum up two cash flows producing a resulting cashflow with netted amounts in the highest granularity of the two initial cash flows. What is a ...
2
votes
1answer
87 views

Putting values into a grid after iteration process

I'm developing a model of thermodynamic cycle in Mathematica. I wrote several functions, applied them to a list containing starting values and iterated, for the model to converge. ...
2
votes
3answers
91 views

List Manipulation matrices

I have the following two lists: List A: ...
2
votes
1answer
144 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 ...
2
votes
2answers
139 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 ...
2
votes
1answer
145 views

Indexing of Large Autonomous System of Equations for Use in NDSolve

I currently have a list of ~150 autonomous DAE's (differential-algebraic equations) that I need to be able to work with using NDSolve. Fortunately I already have ...
2
votes
1answer
106 views

Expand List Operation

On applying a multiplication and subtraction on a list, like so: x = 2y - 4; Where y is a list containing fractions of complex numbers generated from dynamic ...
2
votes
2answers
242 views

Efficient code for building a big list

I would like replace the following code ...
2
votes
5answers
248 views

Creating ordered triplets from an Excel sheet

I have an Excel sheet of the form: " " a b c 1 R S T 2 U V W 3 X Y Z Where every entry is a number (except the blank quotes, ...
2
votes
1answer
364 views

RowReduce: Solving for the resource vector (a, b, c) in Augmented Matrix

Here are two examples: RowReduce[{{3, 1, a}, {2, 1, b}}] evaluates to {{1, 0, a - b}, {0, 1, -2 a + 3 b}} but ...
2
votes
1answer
147 views

How to arrange elements of a list

A file consists out of (x,y,z) data and I need the z-values arranged like this: {{z[1],z[2],...z[idimx]},{z[idimx+1],z[idimx+2],...z[idimx*2]},{....}} With ...
2
votes
1answer
172 views

List-operations only when restrictions are fulfilled (Part 2)

Consider the following: data={{{3544128000, 80}, {3544732800, 80}, {3545337600, 80}, {3545942400, 80}, {3545942400, 160}, {3546547200, 160}, {3547152000, 0}}}; ...
2
votes
0answers
64 views

ParallelTable and expensive functions

I would like to build up a 2D-Table using ParallelTable as follows ...
2
votes
0answers
48 views

What is “ (Dialog) Input [ ] := ” after evaluating a cell?

I have done a time-consuming run and calculation. After many hours ( about 7 hours!), the black color which shows that the cell is evaluating, turn into gray and a strange text appears like this : ...
2
votes
0answers
112 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 ...
2
votes
0answers
35 views

Adding Elements to a List of Lists [duplicate]

I'm trying to do the following: Given a function f[x,y], I want to turn the list {{x1,y1},{x2,y2},...,{xn,yn}} into ...
2
votes
1answer
113 views

Select repeating cluster of numbers [closed]

I have a list with measured data. There are multiple measurements in the list, but each measurement requires some time to find its equilibrium. I'd like to know the positions of the equilibria, but ...
2
votes
0answers
182 views

Taking real and imaginary parts of indexed functions and speeding up ComplexExpand

I am setting up a large system of ODEs and in order to use the IDA method (which is sig. faster for my system and thus attractive), I must split my equations into real and imaginary parts. I am ...
2
votes
0answers
65 views

How to create a ListPlot containing two lists? [duplicate]

I'm trying to plot a set of points where one list corresponds to the X values another list corresponds to the Y values. I have ...
2
votes
0answers
163 views

Exporting Specific Cells of Many Workbooks into One using Mathematica

I currently have a large number of detailed files from which I would like to extract certain cells' information to make an Archive spreadsheet. There are approximately 9 parameters of each ...
2
votes
0answers
179 views

Derivatives of list elements

Could someone explain the odd behavior of the Derivative function when drawing arguments from lists? We have, ...
2
votes
0answers
307 views

Generating a function which outputs possible chemical reactions

I want to make a list of chemical reactions and I write them down in a $\require{mhchem}\LaTeX$ format. They are of the following form $$NA_n^i+MB_m^j \rightarrow \hat NA_{\hat n}^{\hat i}+\hat ...
1
vote
3answers
162 views

Selecting a Point that has the Lowest Absolute x/y-coordinate From a List of Points

Given that there is a set of points, for example, {{3,4,2},{5,2,-1}}. How do I go about selecting the point that has the lowest absolute x, y or z-coordinate from ...
1
vote
2answers
214 views

How to blend some colors on a curve

I need to define a color gradient on a 3D curve, but I'm having some problems with this. Suppose we have a 3D curve defined as a parametric function of some real variable ...
1
vote
3answers
813 views

Loop through a list and select elements

I am new to Mathematica and I have no idea how to make a basic for loop work. I want to loop through the elements of a list: Range[45, 200]. I want to select the ...
1
vote
2answers
1k views

Calculating the distance between the coordinates in a list

I have a list of coordinates {{A[9, 4, 7], 0.0395174}, {A[1, 5, 0], 0.0163797}, {A[0, 7, 2], 0.0577425}, {A[2, 7, 5], 1.01313}} I want to find the distance ...
1
vote
3answers
328 views

How to expand the size of the matrix automatically?

I have a matrix in 2x2 a ={{x, y}, {z, u}} I want to expand this matrix 3x3 b ={{x, y, y}, {z, u, x}, {z, x, u}} 4x4 ...
1
vote
4answers
322 views

List manipulation: position & max value combination

Starting with {{0, 0, 0}, {1, 1, 2}, {2, 3, 3}, {3, 4, 5}} I would like to get {{0, 2, 3, 5}, {1, 3, 2, 3}} where the ...
1
vote
3answers
169 views

Separate an array in two arrays, the even and odd terms being separated in these two arrays

How can I separate the odd terms in one array and the even terms in another array,i.e., go from a={1,2,3,4} to aeven={2,4} ...