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
31 views

Duplicate rows with multiple entries

I have a huge dataset, which looks similar to this: ...
10
votes
3answers
209 views

Find duplicates in list of InfiniteLine

MMA 10 introduced a new function, which can be very convenient: InfiniteLine. Of course, two infinite lines can be described by different arguments: for example ...
0
votes
1answer
44 views

Find the minimum element of a row of a matrix and its column index for each row

I am trying to find the minimum value of a row of a matrix and its corresponding column. For instance, I have three functions: ...
-2
votes
0answers
67 views

unordered lists with maximum dispersion [on hold]

As you can implement the following I have a list $$L = {p1, p2, p3, p4, p5 ........ pn}, n <50$$ I need cluttering and print this list 4 ...
0
votes
4answers
52 views

Matching a Table and a List and building a new Table

I have a Table which includes {Numbers, Probabilities}. For example A= {{1,0.5},{2,0.25}, {3,0.1},{4,0.9}……{100,0.1}}. Put attention that the numbers are 1,2….100 in order. I have a List of random ...
4
votes
2answers
230 views

How do I encode this replacement rule?

I'm pulling a 5x5 array from a larger array. The small sub-array (call it S) can contain any combination of the symbols A, B or 0. What I'd like to do is: if the array contains any matching pairs ...
3
votes
1answer
69 views

What's the easiest way to find the closest point in a list of pairs?

I frequently end up in this situation. I have a solution, but I suspect it's the dumbest way of doing it. Frequently, I'll have a list of pairs, for example: ...
1
vote
1answer
43 views

NRoots Results: From Equations to List of Root Values [on hold]

When I use Roots/NRoots, I get a disjunction of conditions as result. The conditions are normally of the type x == value How can I convert this to the list of root values?
5
votes
3answers
284 views

How do I split a list of numbers to monotonic sequences?

Suppose I have: list = {1, 2, 4, 5, 7, 11, 8, 7, 3, 1, -3, -2, 6, 7, 80} And I want to split it to: ...
3
votes
4answers
121 views

Find the length of the intersection of two lists including duplicates

I have 2 Lists. The first one includes all the numbers from 1 to 10. listA={1,2,3,4,5,6,7,8,9,10} The second includes ...
3
votes
1answer
71 views

Untangling a tangly block of If statements

This is a followup to my previous question: How to simplify block of multiple repetitive If statements? I have another block of If statements, somewhat like the other one I need help simplifying ...
1
vote
1answer
51 views

Extract every nth character from a string

I'm trying to extract every 21st character from this text, s (given below), to create new strings of all 1st characters, 2nd characters, etc. I have already separated the long string into substrings ...
3
votes
3answers
644 views

Why does a certain CSV file import properly into LibreOffice but not into Mathematica 10.0?

I'm working on a project involving data manipulation and it involves working with CSV files. I know that the files are properly formatted as when I import them into LibreOffice, all of the columns ...
1
vote
3answers
305 views
+100

Matching the order of a master list of lists from a random list of lists

Using Mathematica 9, I have 2 lists of lists one master with dimensions {300, 6}. The second is some random order but has the same first ...
3
votes
3answers
173 views

Drop in nested tables?

I want to drop a specified number of elements from a 'table ...
5
votes
4answers
437 views

How to simplify block of multiple repetitive If statements?

I'm building a boardgame...game in Mathematica. I have the board state represented as a matrix. It's a two player game, and each player (let's call them A & B) only has one type of piece or ...
0
votes
0answers
29 views

Pass List / Vector argument through NDSolve to a function

I am trying to pass vector or list as argument to the function from NDsolve.And I am getting these error. Also I am pretty new to stack overflow. Apology if this a possible duplicate. Here is my code. ...
3
votes
0answers
73 views

Kernel crashes when computing finite difference mixed derivative with respect to y & z but works fine when computing with respect to x & y or x & z?

I am using Mathematica 10.4.0 on Ubuntu 16.04. I am trying to solve a set of differential equations using finite difference method on an NxNxN cubic grid (x, y, z directions). I am getting a weird ...
4
votes
3answers
252 views

Enforce monotonicity in a list

Suppose I have a list containing pairs of complex numbers. For example: ...
1
vote
1answer
75 views

Use Map on a Function with two variables

I am new to Mathematica and I would like to find out how to use Map on a function with two parameters such as: ...
0
votes
3answers
119 views

Creating Average Grid data from Co-ordinate and value data

Consider a list: ZXV = {{z1, x1, v1}, {z2, x2, v2},........................} where $z$ is Z co-ordinate, $x$ is X co-ordinate, $v$ is the value at the point ...
3
votes
2answers
98 views

How to generate a limited number of tuples of a list and not all?

I have a question for which I couldn't find an answer: how can we generate only a given number of tuples of a list and not all of them? For instance, I want to have only the first two 3-tuples of ...
5
votes
4answers
193 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 ...
3
votes
4answers
249 views

Duplicating and arranging a list

I have a list, {a,b,c,d,...,z} And I want to duplicate that list n times such that, {a,a,a,b,b,b,c,c,c,....z,z,z}. I ...
1
vote
2answers
95 views

How Do i Extract Only The Coordinates xyz (Number) From This Log file

this Log contains the information of all coordinates of many atoms in a molecular dynamics simulation for a long sequence of time steps, along with some extra information other than the coordinates. ...
1
vote
2answers
72 views

How to repeat a set of operations on a single data set?

I am very new to Mathematica and I just couldn't figure out the solution for the following problem. I am trying to iterate the following functions for 10 times. For instance, "a" to "fullData". The ...
0
votes
0answers
31 views

Normalize Elements of lists [closed]

I have a list that I need to normalize, list = {{a,b,c}, {d, e, f}, {g, h, i}, {j,k,l},...} I want to normalize ...
1
vote
0answers
43 views

List manipulation, averaging over lists and fidelity

I want to create vectors from a function poly[α_, β_, δ_, ϕ1_] were several variables (α, β, δ) are randomly sampled from a unit sphere. Then I want to vary another ...
0
votes
2answers
62 views

Plotting cicle using ListPlot

How can I plot circle plot with ListPlot function or how to organize data to produce circle plot from ListPlot function ? If u do something like this ...
3
votes
1answer
90 views

Replace list element with element from another list based on condition

I Have a list on integers and another list of "duplicates". E.g. start={{3},{1},{2},{4}}; duplicates={{1,4,7},{5,6}} I would like to substitute each element of ...
10
votes
9answers
715 views

Forming an upper triangular matrix from the elements of a list

I asked this question before, but i was closed because it the question was not comprehensible enough. So i reworded it, hope that's ok. I have a list with 6 elements. ...
8
votes
4answers
225 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 ...
0
votes
1answer
29 views

Iterating KroneckerProduct[] and returning the result from a function

I am trying to write a function which will take a matrix m and an integer i as inputs. Then it will compute the Kronecker product of m with itself i times and return the result. The code is as ...
3
votes
4answers
175 views

select elements in a list

I am new in Wolfram Math and I need a help in making a simple program. Let's suppose we have a list: list = {{1, 11}, {2, 7}, {4, 2}, {7, 9}, {-2, 3}, {-1, 10}}; ...
4
votes
3answers
117 views

Alternative forms to Table for iterating over replacement rules

I have a multivariate polynomial x. I get coefficients of various monomials using CoefficientRules, which returns a list of ...
-1
votes
3answers
75 views

Create table of elements which belongs to specific sets

I would like to produce elements (preferably by Table or For-If commands) that they belong to specific sets. For example I want to write positive integers from 1 to 100 such that they are $2 \pmod 3$, ...
1
vote
1answer
82 views

How to determine distance of periodic features in measured dataset

I have a list of x- and y-values associated with a measured height (z-values). Part of the list is plotted below. As you can see, there is a periodic arranged structure, namely a cross. Now I would ...
-6
votes
0answers
51 views

rename files randomly

I need to read a directory with pdf files, rename them by numerical sequence of 8 digits when lifting with pdf extension, and then record the result (the idea is that they are totally random names ...
9
votes
1answer
185 views

Fast implementation of Metropolis-Hastings update with multiple sets

This is an optimisation question rather than something I am unable to do. I have a naive, primitive working version of the code (I submit it below) but I am trying to make it work faster. I am asking ...
2
votes
3answers
231 views

How to use Select with lists

I am trying to do: Select[minimus[[6]], #1[[2]] < (min[[6]] + emin[[6]]) &] applied to all elements of minimus, ...
0
votes
0answers
26 views

factoring a phrase of matrix elements and calculating main eigenvalues

I have a question containg two parts: 1-If we have a matrix as ...
15
votes
9answers
617 views

Any built-in function to generate successive sublists from a list?

Given lst = {a, b, c, d} I'd like to generate {{a}, {a, b}, {a, b, c}, {a, b, c, d}} but using built-in functions only, ...
5
votes
3answers
250 views

Indicate minimal path sum

Described on the page: http://www.mathblog.dk/project-euler-81-find-the-minimal-path-sum-from-the-top-left-to-the-bottom-right-by-moving-right-and-down/ It is an example of the solution indicated in ...
0
votes
1answer
47 views

How to pad numbers to the border of the Matrix?

I want to pad the numbers,but it throws an error Part::partw,so I use Quiet to suppress this error. ...
3
votes
1answer
66 views

Calling results of applying f to expr inside NestList

Being new to Mathematica, I try to follow the suggestions of using NestList, Map, Table ...
5
votes
1answer
39 views

Heading in Table Form Question

I have: modadd = Table[Mod[i + j, 3], {i, 0, 2}, {j, 0, 2}]; TableForm[modadd, TableHeadings -> {{0, 1, 2}, {0, 1, 2}}] Which produces: How can I put a ...
3
votes
1answer
172 views

Minimize sum of array elements subject to conditions

I have array where each point at different times are shown parameters ...