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

learn more… | top users | synonyms (5)

-1
votes
1answer
46 views

How to graph the max and min values of a sheet?

Hi I just start working in Mathematica version 10.3.1 and I want to graph a sheet of data that I created in Excel (yeah i use Windows). The problem is i have so many data; 200 columns and 50 row of ...
-1
votes
1answer
41 views

Generate list of first 100 prime number? [closed]

I know how to generate a list of prime numbers up to a limit, but how would I generate the first 100 prime numbers in a list?
3
votes
2answers
93 views

Using “Outer” with “ChineseRemainder”?

I'm looking to build a $7\times3$ matrix using ChineseRemainder. Trying to use ${0,1,2,3,4,5,6} \pmod 7$ and ${3,15,21} \pmod {30}$ so that the first element of ...
0
votes
0answers
55 views

ListDensityPlot3D with discrete user data

I have a ext file with 7 columns and 5.000.000 lines (a trajectory file for a particle in 3D). After normalizing position vectors for each frame to norm 1, I basically obtain a list of three ...
3
votes
2answers
67 views

Calculate Cumulative Mean and Standard Deviation of a list without FOR loops [duplicate]

I have a simple list mylist={x_1,x_2,...,x_N};. Now I want to map a function over this list, e.g. the Mean and StandardDeviation functions, so that it will give me ...
5
votes
3answers
120 views

How to partition a set with a condition on subsets?

I want to partition a set of $n$ elements into $k$ subsets with a condition For example: partitioning this set {1,...,5} into 3 subsets with this condition: if $|i-j|<d$ then $i$ can't be with $j$ ...
0
votes
1answer
49 views

Append[] is not working for empty list [duplicate]

I am trying to create an empty list and add an element but the list is not being populated. My code ...
0
votes
1answer
89 views

How to turn a subroutine into a function?

I've written a subroutine that takes in 6 matrices and after some manipulation returns back 3 new ones. I will use this subroutine fairly often in this notebook so I think it would be easier to turn ...
0
votes
0answers
39 views

Do[If[ *stuff* ]*arguments*]: Increasing range over which Do iterates changes results of If?

Summary: If I run the same Do[] expression but with the variable(s) over which I am iterating taking on more values (but same increment), an If statement inside the Do[] evaluates as false a few times ...
6
votes
2answers
324 views

Performance of calculation of means squared displacement

How can I improve the performance of the following code which calculates the mean squared displacement for coordinates stored in data? Here for each time difference ...
0
votes
1answer
41 views

Help with limiting output

I wrote this program on Mathematica (which I am very new to): ...
11
votes
4answers
478 views

How do I extract a matrix of only positive numbers given a set of assumptions?

I want to divide a matrix: mat = {{a, 0, -b}, {d, a, 0}, {0, 0, -a}} with the following assumptions: ...
10
votes
4answers
262 views

Convert elements of list to string

how easily can I convert elements of this list to string. If I have output like this: {{M, 1, 0, 0, 1, 1, 1, 0}, {A, 0, 0, 0}} And I want something like this: ...
0
votes
1answer
74 views

ListPlot and Show n plots from two lists with large n

For the context, I have been dealing with Random Matrices and Dyson Brownian motion. I have two lists, the first one contains the number of steps, so ...
1
vote
0answers
49 views

Estimating processing time for commands

I am trying to evaluate some equations by using Taylor series of expansion (Series[], ExpandAll[], and Normal[] command), and using n equation and n unknown (Solve). Following is not full command (if ...
4
votes
3answers
126 views

Replicate sublist in new list

If I have a list of lists $a$ and a list of occurrences of each sublist $n$ a={ {1,1,1}, {2,2,2}, {3,3,3} } n={1,3,2} what is the most efficient way to get the ...
5
votes
2answers
309 views

How to construct a dataset with lists as columns

So I know this should be pretty easy, but I cannot seem to find a solution anywhere, so thanks in advance for your help: I have three Lists (with numbers as ...
8
votes
4answers
224 views

How to get this list with a terse method

If I have like {a,b} and I want to get {{a+1,b},{a-1,b},{a,b+1},{a,b-1}} We don't care about the ordering of the ...
6
votes
3answers
167 views

How to prevent substitution in a part of an expression?

Background: I am trying to write a program that can execute scheme in Mathematica. Now I have things like {"+", 3, {"-", 2, {"'", {"*", 1, 3}}}}. The syntax ...
5
votes
5answers
271 views

How can one get all possible sublists of a list? [duplicate]

So if list={1,2,3} then output should be {{},{1},{2},{3},{1,2},{2,3},{1,2,3}} or in different order.
-1
votes
1answer
87 views

Lattice model array for distribution of energy [closed]

Edited for clarity I am trying to make a 2-D array constant, lets say 100x100, and perform a function on that. The array would look like ...
0
votes
2answers
54 views

RSolve - basic question about using rules as functions

I think this is basic question, but I can't find it in Help... (I am begginer :P) I have this expression ...
11
votes
2answers
404 views

How to fill a grid make its total be largest

I have a blank grid whose dimension is 5*5. I want to fill it with some number using 1, 2, 3 and 4. But in every blank space if you fill 2, its neighbor (include four direction, such as left, ...
10
votes
10answers
678 views

Matrix indexed by one number

I'm trying to find a generic way (for arbitrary dimensions) to create a matrix like so a[1] a[2] a[3] a[4] i.e where it is indexed by one number, instead of say ...
3
votes
5answers
154 views

How do I select strings based on the number they end in?

I have a list of alphanumeric strings, str = {"ANH7134UR1", "ANH7134UL4", "ANH7134UR7", "ANH7134UL17", "ANH7134UR18"}; that I want to assign each string to ...
5
votes
1answer
92 views

list of all permuations of sublists of a nested list

I've got a certain class of lists with, say, 4 elements, that are lists themselves. E.g. {{1, 2, 3}, {4}, {5, 6}, {7}}. I'd like to find a way to generate a list ...
1
vote
0answers
23 views

How do I add a finite value to one component of a set of vectors [closed]

I have a set of (x,y) values in some *.csv file, when I open them with Mathematica to plot it some of the plots are shifted so I need to add some finite value to one of the components of every vector. ...
1
vote
0answers
42 views

List within a Do loop , i cant get any values [duplicate]

I am having the following problem. I am trying to get some values from solving an equation and apply them into a list but in the output I get nothing but the symbol of the variable... The code is as ...
5
votes
2answers
212 views

Why SetDelayed won't work

I'm trying to do this: Riffle[list = {a, b, c, d, e, f}, tem = RandomInteger[1, Length@list-1]] {a, 0, b, 0, c, 1, d, 0, e, 0, f} But I think this method is ...
5
votes
4answers
192 views

Creating Nested For Loops for modifying values to append to a List

Basically, the title says it all. I am familiar with python, not so much with mathematica. For the program, I am starting out with three unique lists of values for which I am using a triple nested ...
0
votes
0answers
31 views

Envelope of a given table (or plot)

Is there any way to construct an envelope of a given table (list) or plot? For example, I have plotted (used ListPlot of txt-file) And then I want to plot the envelope (upper or lower) of this plot ...
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 ...
0
votes
1answer
74 views

How to ListContourPlot a functional eigenvalue spectrum?

We have a (Hermitian) matrix of some finite dimension (n) whose elements are functions of real variables x and y. We wish to plot contours of the spectrum (level sets of the n real eigenvalues) at ...
6
votes
1answer
73 views

Function that counts number of consecutive elements after iterator in Table command

I have a 1D Table, something like this, that I want to turn into musical notes: ...
7
votes
3answers
155 views

Nonzero element positions of a matrix

Let m={{1, 2, 0}, {4, 0, 9}}; I want to find the position of every nonzero element of the above matrix. The code ...
11
votes
2answers
263 views

How to mesh a region using adaptive cubic elements

Assume a list of {x,y,z} coordinates. The coordinates are arranged in a regular fashion through a fixed raster size (called ...
8
votes
5answers
291 views

What is the most efficient way to replace items in a list at periodic intervals?

For example, if I want a list of $\phi(n)$ for $1 \leq n \leq 100$ but if $n$ is a multiple of 3 I want to show a 3 instead of $\phi(n)$. I tried ...
1
vote
1answer
40 views

How to solve from a list

I have this equation: $y(t)=aE^{-bE^{-ct}}$ and I have this list: ...
0
votes
3answers
95 views

How can I extract the x and y values from a coordinate pair? [closed]

I think the question says it all. I have a coordinate pair, {x,y} and I want to extract x and y for use in further calculations. Can't find anything in the docs about this but it seems like it should ...
1
vote
1answer
53 views
6
votes
3answers
109 views

Differentiating between zero and “empty” in lists, and adding them?

(Edit: I mean 'differentiate' as in telling the difference between two things, not as in f'(x) ) I have n series of numbers, let's say two for example, with some "empty" spaces between the numbers, ...
3
votes
4answers
116 views

Assign a list of sums to indexed variables

I want to generate a list of sums {a, b, c, d, ..., z} and assign them to a list of variables such that ...
3
votes
1answer
63 views

Import Excel sheet into 3D array, 1st row and column as x- and y-axis

It might be simple, but for me, it took several hours working on, but still cannot figure out. Basically, I'd like to create 3 dimensional list data ({x,y,z}) from excel file, so I can plot them ...
4
votes
2answers
53 views

positions satisfying pattern and grouped

I have a list of numbers and I am looking for a way to most efficiently find positions of values that satisfy a certain condition and group those positions that are sequential. To illustrate, a simple ...
2
votes
3answers
81 views

How to get a C4-symmetric (coincides after 90° rotation) matrix via `ImageData` from `Graphics`?

I tried an easy example with Disk centered at {0,0} with radius 1. Obviously, that object is C4-symmetric. Further, ...
4
votes
1answer
127 views

Insert a symbol include first and last position [closed]

Assume we have a list list = {"a", "b", "c", "d", "e", "f"} Then use this code: StringRiffle[list,"*"] But ...
4
votes
1answer
73 views

Joining table of tuples with table of scalar values [closed]

I have a table of dimension $M \times N \times Q$ of 3-tuples {x,y,z} that represent points, and another table of dimension $M \times N \times Q$ of scalar values. ...
0
votes
0answers
23 views

Finding the percent difference between elements of a matrix and a list/vector [duplicate]

I have a large matrix of 24 columns, 11 rows, and a vector in the form of a one column, 11 row table. What would be the best method of finding the percent difference between each element of the matrix ...
3
votes
1answer
59 views

overlap of data

I have two individual Date lists as Date Objects: List 1 = {1 Jan 1991 9 :00 , 3 Jan 1991 11:00 ..etc } List 2 ={ 7 Jan 1991 14:00, 9 Jan 1991 15:00 ..etc} For ...