378 views

Find the identical rows in a matrix [duplicate]

Suppose I have the following matrix: ...
417 views

Randomly distribute numbers to lists

I have 4 empty lists. I would like to randomly distribute numbers from 1 to 10 to these 4 empty lists. How can I add integers to lists randomly? For example: ...
208 views

position of intersection of two lists

I have the two lists: ...
146 views

How to get a description of the positions of similar elements in a list

I want to find a function F to represent the positions of identical elements in a list, which means, for example: ...
146 views

Determining lists with equal elements in the same position

I would like to define a function with the following properties: Given a list of equal length sub-lists ls={{a,a,a},{a,b,a},{a,b,c}}; Define a function ...
764 views

intersection between two 2D arrays with labeled data is slow

Here is how to Generate data the function is below with two images to generate data img1 img2 ...
302 views

Interpolating four-dimensional data

In this case it is not easy to work with a MWE, so I shall use the actual data which contain initial conditions $(x,y,p_x,p_y)$. Let's see how the data look on the $(x,y)$ plane ...
187 views

Summing elements in a list by groups indicated by a list of indices

I have two lists, one containing values, the other indices. Now I want to accumulate the values that have the same corresponding index. So for example: ...
267 views

Using Select in Subsets [duplicate]

I have a list: list = {{7, 6, 14, 14, 4}, {4, 9, 8, 11, 14}, {20, 12, 12, 11, 3}, {7, 4, 11, 7, 20}, {2, 13, 17, 11, 19}} I did a test to identify where ...
820 views

Partitioning a list when the cumulative sum exceeds 1

I have a long list of say 1 million Uniform(0,1) random numbers, such as: dat = {0.71, 0.685, 0.16, 0.82, 0.73, 0.44, 0.89, 0.02, 0.47, 0.65} I want to ...
461 views

Positions of elements in the initial flattened list in a split list

Say, we have a list: m1 = {2, 2, 7, 0, 7, 7, 2, 2, 2} It can be split easily: ...
877 views

Easiest/most efficient way to delete duplicates from one list at the positions of another?

This question is somewhat related to How to efficiently find positions of duplicates? , although I'm interested in something a little bit simpler since I'm not really interested in a list of all the ...
532 views

Pick elements from list “separately”

I have the following list I want to pick elements from: mylist = {1, 5, 7, 3, 4, 7, 2, 9, 9, 1, 10, 12, 2, 64, 34, 64} I have another list with 0's and 1's which ...