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

learn more… | top users | synonyms (5)

2
votes
1answer
145 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
238 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
1answer
106 views

Experiment with TagSetDelayed involving Part

Reading Associating Definitions With Different Symbols, I was intrigued by this: You can think of upvalues as a way to implement certain aspects of object-oriented programming. A symbol like ...
2
votes
2answers
79 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
98 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
1answer
853 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
890 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
342 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
136 views

How can I make check boxes that put elements into a list?

Right now I have a blank list that I am putting in Manipulate[]. I want to be able to choose whether 1,2, or 3 are in this list by setting z1,z2, z3 as True or False: ...
2
votes
1answer
119 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
123 views

order items of a table

I am trying to change order of a table. ...
2
votes
1answer
171 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
2k 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
184 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
190 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
1answer
92 views

Interpolation of a multivariate function with duplicated 2D abscissa points

I want to interpolate a function q[a,b] I have a data file which has the form {a,b,q} a sample is following ...
2
votes
2answers
44 views

Partition a list into TradingChartformat

I want to make a stock chart by using TradingChart with my own data. But, the imported data is in the format ...
2
votes
1answer
46 views

ndsolve interpolatingfunctions not shown/evaluated

Using this technique from Simon, I want to solve a matrix differential equation with a matrix that contains an explicit time-dependence(our variable), but I want to be able to solve this problem for a ...
2
votes
1answer
60 views

Change some elements at the second level of a list based on some conditions

I need to change some elements at the second level of a list based on some conditions. I have the following list of objects of the same type: ...
2
votes
1answer
94 views

How to find the local minimum points in the multi-dimensional numerical data?

I am trying to get some local minima of an n-dimensional function (which only has numerical form). For two-dimensional function data, we can find the local minimum points from the contour plot easily. ...
2
votes
1answer
61 views

3D-Plot of a list of complex numbers and a list of real numbers

I'm a newcomer to Mathematica, and I'm having trouble with the following question. Say we have a list of complex numbers list1 and a list of real numbers ...
2
votes
1answer
100 views

Removing characters from non-strings

I have a large list of lists that contains mixed data, some real, some strings. The lists are of various lengths and depths. Some of the real data values have an asterisk appended to them, e.g.: ...
2
votes
1answer
237 views

Appending elements to a list in parallel table

Is there any way to store values in a list that is being computed in parallel? For example, if ParallelTable is computing some ...
2
votes
1answer
118 views

Request for Explanation in case of Replacement not working

The 2 code snippets work on a matrix ABg with 22 rows and two columns containing Strings. Some entries in column 2 are List { } to be recognized by the first Character "{". In the list some items must ...
2
votes
3answers
113 views

Comparing two lists lexically

I have two lists of integers a and b of equal length, and I would like to define a>b as ...
2
votes
3answers
83 views

How to manipulate one column of a table using the value in another column

Let's imagine I have the following table structure data = {{a, b}, {c, d}, {e, f}}; and I want to transform it into the following table ...
2
votes
2answers
122 views

How to make functions from datasets

I have a csv that encodes the results of plugging certain parameters (say, A and B) into certain functions (say, ...
2
votes
1answer
72 views

Manipulating lists with uneven amounts of entries

So I have a list like so list={{a},{b,c},{d,e,f},{g,h}} and the basic logic I want is to be able to manipulate each of the nested lists individually. So If I ...
2
votes
2answers
142 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
286 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
228 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
122 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
104 views

List Manipulation matrices

I have the following two lists: List A: ...
2
votes
1answer
222 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
1answer
167 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
1answer
404 views

Derivatives of list elements

Bug introduced in 8.0.0 and fixed in 9.0.0 Could someone explain the odd behavior of the Derivative function when drawing arguments from lists? We have, ...
2
votes
2answers
275 views

Efficient code for building a big list

I would like replace the following code ...
2
votes
5answers
439 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
572 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
159 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
204 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
24 views

Find same list elements of two lists [closed]

Example: I have two 2D lists (each list has no duplicate elements): l1 = {{1, 1}, {2, 2}, {3, 3}, {4, 4}}; l2 = {{1, 1}, {3, 3}, {5, 5}}; How can I create a new ...
2
votes
0answers
69 views

Function output

I would like a function that computes Cartesian product of two sets z=(Tuples@{#1,#2}), and computes the number of elements in this set(list) ...
2
votes
0answers
38 views

Generating a List of Numbers with “Table” Causing Deviation [closed]

I'm trying to generating a list of numbers with the function table. But it caused a little deviation which I didn't expect. Let's say I need a function like: ...
2
votes
0answers
52 views

How can I convert some data in TableForm to a list form like as {{0,1}, {1,2},{…,…},…,{m,n}}? [closed]

How can I convert some data in TableForm to a list form like as So, I have some data there I take from laboratory, but the data has a TableForm 0.0 0.2174 1e-06 0.2178 2e-06 0.2172 3e-06 ...
2
votes
1answer
100 views

Automatic text-wrapping in labels in `TimelinePlot`

Part-related to this question and part-related to this one, I would like to make use of the new features of TimelinePlot in 10.3, but would like to incorporate some ...
2
votes
0answers
49 views

Transposing a table [closed]

I created this table so that it is a collection of 5 different functions that I need. It outputs the values that I want, however, I cannot figure out how to get the orientation right. I would like to ...
2
votes
0answers
18 views

Plotting list of functions while some of them are undefined [duplicate]

I'm struggling with the following code ...
2
votes
0answers
39 views

Product of two list of different size [closed]

This has to be very easy, but i can find it. I have 2 list a={8, 15, 12, 1, 13, 21, 14, 4, 15} b={3, 19, 29, 47, 13} What ...
2
votes
1answer
58 views

Manipulating and adding elements in a matrix [duplicate]

I have the following j = {{1, 2}, {3, 2}, {5, 4}, {1, 2}, {3, 2}} k = {1, 2, 3, 4, 5} t = SparseArray[j -> k, Max@j {1, 1}] The above creates a 5x5 matrix ...