199 views

### Split sorted list of integers by groups of consecutive integers [duplicate]

Im a trying to split a sorted 1D list of integers by sets of consecutives integers. The keywords in the question didn't trigger the answers I was looking for so I ask the question, no matter how ...
324 views

### How to create sublists of consecutive elements? [duplicate]

I have a list of elements, for example: myList={5, 12, 16, 18, 19, 24, 28, 29, 31, 32, 35, 42, 43, 47, 50, 53, 60, 61, 62, 64, 79, 82, 84, 92, 105, 128, 136, 153, 154, 155, 156, 158, 159, 160, 164} ...
100 views

### Easy way to covert a Range or set of vales to an Interval object [duplicate]

I am generating data such as {4,5,6,7,8,9,20,21,22,23,24,25,78,79,90}. This list can reach thousands of elements. Is there a simple or good method to convert such a list into a set on Interval ...
62 views

### Partition lists into sub-lists based on whether they are consecutive or not [duplicate]

I am new to Mathematica and would appreciate any help. I'd like to partition my data which is comprised of {time x analog input} into sublists of consecutive time. In other words, my data looks like ...
132k views

### Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
11k views

### Generating a Sierpinski carpet

I am trying to draw a Sierpinski_carpet. I have code that works, but I think there is a more elegant way to do than my way. Maybe I couls use Tuples or ...
3k views

### Map a function across a list conditionally

It seems that this is a really basic question, and I feel that the answer should be obvious to me. However, I am not seeing. Can you please help me? Thanks. Suppose I have a list of data ...
7k views

### Generating a list of numbers that are not multiples of 4

I want to write simple code that will list all numbers from $1$ to $n$ that are not multiples of $4$. And in this case I consider that ...
4k views

### Find zero crossing in a list

I'm looking for a function that finds the index of the zero-crossing points of a list. Before I go making my own subroutine to do this, I was wondering if anyone knows of any built-in Mathematica ...
848 views

### Count the sequences in an array

Is there a short and easier way to count number of sequences in a list? Let's say I have three lists: list1 = {0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0} ...
5k views

### How to find rows that have maximum value?

Suppose if I have following list { {10,b,30}, {100,a,40}, {1000,b,10}, {1000,b,70}, {100,b,20}, {10,b,70} } How to find rows that have max value in ...
2k views

### Find longest sequence of zeros in list

How it is possible to find the length of the longest sequence of zeros in list {1,0,0,1,1,0,0,0,0,1,0,0,0,1,1,0,0,1} which is equal to 4 in the sample list above
671 views

### Dropping n consecutive terms from a list periodically

Suppose I have the following list lis = Range[100]; and I want to remove n consecutive terms periodically from the list. For example suppose I want to drop terms ...