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

learn more… | top users | synonyms (4)

1
vote
1answer
31 views

Adding up a list of subscripted elements

I have a list of entries with subscripts. I want to add just the entries. How can I do that in the presence of subscripts? For example: list = {1a, 2b, 3c} And ...
1
vote
2answers
48 views

How to compare and remove x-coordinates (and the associated y-coordinates) that are less than previous x-coordinates?

I am using Mathematica version 9.0 and am trying to compare and remove x-coordinates, and the associated y-coordinate, that are less than previous x-coordinates. Below is an example using sample data. ...
1
vote
1answer
35 views

Deleting duplicates of plus or minus symbolic quantities from a list [on hold]

Let's say I have a list l = {a + bc - d, -a - bc + d, a + b};. Now I want to apply DeleteDuplicates[l, crit] to this list, such ...
0
votes
0answers
35 views

Graphics3D evaluation order problem

I have the following block of code: ...
3
votes
3answers
177 views
0
votes
0answers
38 views

Transform a vector DE into a set of scalar DEs [on hold]

I have the vector equality: {{a,b},{c,d}}.D[{x1[t],x2[t]},t]=={{e,f},{g,h}}.{u1[t],u2[t]} I want to solve this using DSolve. ...
3
votes
1answer
43 views

Saving Dot-ed eigenvectors in a special comparison

We have produced a 4*4 matrix in any iteration containing nx from 0 to 2 by steps of 0.5. and in any iteration we have saved sorted orthogonalized-eigenvectors based on their eigenvalues with this ...
5
votes
2answers
123 views

Displaying a list of percentage values according to their classification

I have a list of percentages as follows: percent = {21.15, 42.3, 57.68, 73.06, 84.6, 90.37, 96.14, 99.99, 99.99, 99.99, 99.99} I want to classify these ...
0
votes
2answers
39 views

“Part specification is longer than depth” warning in Position function [duplicate]

I'm working on a project which analyzes financial data. I download the price and dividend information for the SPY ETF which tracks the S&P 500: ...
-2
votes
0answers
66 views
1
vote
2answers
65 views

How to find the same number in sublists of list

Intersection[Table[Table[Sqrt[p1]/r1,{r1,0.1,0.7,0.1}],{p1,0.5,5,0.5}]] I am trying to find same numbers in the sublists. But Intersection is not working for ...
1
vote
1answer
48 views

calculate relationship between cause and effect (rows/columns/delta etc.) on tableform

I tried to enter this Excel (on the right of the picture) information to program. following these codes has been used: ...
2
votes
2answers
143 views

Efficient List of Lists

I'm running some analysis that requires the creation, row by row, of a large list of lists. The big list is called "Nodes" and it will ultimately contain hundreds of thousands of rows. The first few ...
6
votes
2answers
57 views

How to count the number of values in a discrete function?

I have a discrete function of an integer variable $n$ defined like this : ...
4
votes
4answers
237 views

Replace matrix rows conditionally while avoiding For loop

I have the following variables: myMatrix={{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}} myIndices={1,3} I need to replace the rows ...
-1
votes
1answer
44 views

Position not working? [closed]

I have the list: myList={0,0,0,a,b,c,0,0,d} I need to find the positions of all elements that are non-zero. I do like this: ...
0
votes
0answers
49 views

How to replace element by element in a list? [closed]

I have the list: myList={{a,b,c},{d,e,f},{g,h,i}} I need to transpose every element individually, so I do: ...
6
votes
1answer
65 views

Problem Using Evaluated Replace with Associations

If I define some function like: toISOdate[data_List]:=DateString[data,{"Year","-","Month","-","Day"}] and try to applicate it in an ...
5
votes
3answers
224 views

How to imitate list comprehensions for constant arrays?

In Python, ['a'] * 10 generates ['a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'] and ...
4
votes
2answers
46 views

Inputting values into the variables without having to input the matrix all over again

I'm practicing using LU decomposition on Mathematica. I am able to find the L & U matrices, specifically the variables. However, i find it tedious having to input the newly found values and form ...
0
votes
1answer
58 views

Count participation of variable list

I have the directed edges of a graph given by a list of variable (vertex) pairs. ...
2
votes
1answer
46 views

How to extract part of association?

Considering an association: asc = <|"a"->1, "b"->2, "c"-><|"e"->3, "c"->4|>, "d"->5, "e"->6, "f"-><|"g"->7|>|> How ...
5
votes
3answers
154 views

List all “duplicate” elements in Tally

Tally[list,test] can use a custom function test to judge if elements are equal. But the output will only give the first element ...
2
votes
1answer
109 views

How can I write a loop to get many values from a solution?

I am looking at the value of x[t] at day t = 200 over several years. I tried to do it using a For-loop but it didn't work. This ...
0
votes
0answers
35 views

Binomial decomposition of a list? [closed]

Given a list L with n elements, I would like to generate all possible unordered subsets of ...
3
votes
2answers
73 views

Find sub-sets of vanishing additions or subtractions from a list?

Let's say I have a list L containing n numerical numbers. Now I want to find all sub-sets of ...
2
votes
2answers
51 views

Import a column of data, make a matrix from it and export it WITHOUT curly braces

I'm new here and with Mathematica, too. I want Mathematica to import data from a txt file (it has one column of data). These entries are z-values. From this I want to make a matrix - 508 entries make ...
3
votes
3answers
135 views

Find position avoiding For loop

I have a list: {a,b,c,d,e,f} And a function sizeFunc[element_] which returns the size ...
2
votes
1answer
43 views

Dropping rational coefficients

I have a list of expressions (they all are exact numeric quantities, not containing any variables), some of them have integer or rationals coefficients, or complex coefficients with rational or ...
1
vote
0answers
28 views

Accessing the elements of a list of values [closed]

I have a list of polynomials (all with the variable x) called lyle and a function that accesses this list and evaluates it at ...
2
votes
2answers
95 views

Replace elements in some region in a list

I want to replace some elements in list. Assume that we have A={{1,2,3,4}, {5,6,7,8}, {9,10,11,12}, {13,14,15,16}} and we want to replace elements ...
1
vote
1answer
47 views

Sort and Save Matrices Eigenvectors to a Larger Matrix

We are going to sort and save all orthoginalized-eigenvectors of 4*4 random matrices (produced in any iteration) to a larger matrix such as storagematrix. Since, produced random matrices are 4*4, ...
0
votes
1answer
62 views

Match a variable name pattern [duplicate]

I have a list of variables: {RBI,RCD,ASD,FGH} I want to select only those whose name starts with R. Using the pattern Rx_ ...
2
votes
3answers
115 views

Join nested lists based on first and last elements within each list

I have a nested list like this: test1 = {{1, 3}, {1, 4}, {1, 7}, {2, 1}, {3, 5}, {4, 1}, {5, 2}, {6, 1}, {7, 6}} I want to join the lists together depending on ...
0
votes
2answers
49 views

Identify a scalar, a list

I have a symbolic scalar m2 and a symbolic list (representing a 3x3 matrix) A. I want a function which does something like: ...
1
vote
2answers
61 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 ...
3
votes
3answers
150 views

Move element inside a list

I need to change the position of a single element in a list. Example: I start with: {a,b,c,d,e,f} I want to move the a before ...
7
votes
4answers
229 views

Improving a selection routine

How can this code for extracting the smallest (absolute) real value be improved? and would it be simpler using associations? ...
-1
votes
2answers
66 views

Delete Element within a List based on the Order [closed]

I want to do the following, deleting the element of a list that do not match an increasing order as example: {1,2,3,4,6,5,7,8}->{1,2,3,4,6,7,8} I've thought of using DeleteCases but I'm not able to ...
0
votes
3answers
77 views

Do not expand matrices in Mathematica calculation

Here is an example of a problem I'm having. Consider that I have defined: omega={{p[t]},{q[t]},{r[t]}} x={{a},{b},{c}} R={{1,2,3},{4,5,6},{7,8,d}} What I would ...
0
votes
0answers
26 views

How to show different DateListPlots with a popupmenu with different plot parameters

I bumped into the following problem: I have a relatively large dataset (250k row,11col), imported in from an SQL database. The format of the data is {{year,m,d,h,m,s},value}. I have successfully ...
2
votes
3answers
503 views

For loop in Length computation code

Here is a code I wrote that is supposed to give the length of list after some splitting and regrouping. But it is inefficient. Is there a way to rewrite in more professional and efficient way? I guess ...
0
votes
3answers
50 views

Dynamic insertion of variables

I have a list of eigenvectors of a given matrix. I need to programmatically modify this list by multiplying each vector by a variable #i, e.g. ...
-1
votes
2answers
43 views

Changing the precision of data in a list of matrices

I have a list of matrices ...
5
votes
7answers
426 views

List manipulation challenge

It's necessary to get from list = {{a1, b1, c1}, {a2, b2, c2}, {a3, b3, c3},{a4, b4, c4}, {a5, b5, c5}}; I'd like to do this with ...
0
votes
0answers
32 views

Dot production associated with comparison process of different matrices eigenvectors

With thanks to Guess who in the link module using.. We created functional 5*5 matrices: ...
0
votes
1answer
48 views

Module using for creating a table [closed]

I want to have a 4 tables with using of module. Unfortunately I don't know why doesn't it work ...
2
votes
1answer
61 views

List of list to list of rules

I have a list of this type p = {{y, 1, 3}, {x, 2, 0}, {z, 3, 1/(k + 1)}} I can use a Do loop that is ...
7
votes
1answer
103 views

Converting a Table to a Dataset

I feel like this is a simple task, and there may be a built in method to doing this (but I can't find it if there is). I would like to be able to take a table and convert it into a structured Dataset. ...