Linked Questions

6 votes
4 answers

Find min and max indices of highest and lowest elements in sorted list

I have a list of integers of the form ...
az123p's user avatar
  • 239
10 votes
2 answers

How to parallelize and speedup AppendTo? [duplicate]

Say I have a list of original data (for now generating random list as follows): ...
string's user avatar
  • 167
6 votes
7 answers

How to find the smallest position of an element of an ascending list {1,4,10,12,20} such that the element is not less than 11?

Assume I have an ordered, ascending list {1,4,10,12,20}. I want to find the smallest position of an element of the list such that the element is not less than 11? ...
Display Name's user avatar
  • 2,029
8 votes
2 answers

Best way to insert element into an ordered list at the correct position?

Suppose I have an ordered list orderedList and I want to write some code that will involve regularly inserting new elements into ...
WillG's user avatar
  • 960
5 votes
4 answers

Inserting an integer into a sorted list

I'm wondering if inserting an integer into a sorted list (in a way that the list remains sorted) can be performed in Mathematica in some fancy way in $\log(N)$ time?.. The question was asked here, ...
mavzolej's user avatar
  • 693
1 vote
1 answer

Choosing data from list and plot [duplicate]

I have a data set like below: Angle={5.48575, -0.669213, 45.9832, 8.63878, -16.8777, 50.022, -41.8882, -45.956, 28.3005, 35.8234} Now want to select the ...
Xavier's user avatar
  • 155
17 votes
2 answers

Most efficient numerical selectBetween

Often when I'm working with numerical data I want to select those points within a given range. To do this I generally do something like: ...
b3m2a1's user avatar
  • 46.9k
4 votes
4 answers

Extracting elements in a list based on conditions [closed]

I have the list \[ScriptCapitalD] = {824, 1082, 1135, 1308, 1359, 1372, 1401, 1412, 1601, 1638, 1641, 1674, 1709, 1805, 1947, 2208} I would like to ...
Physkid's user avatar
  • 680
10 votes
4 answers

Taking Part of an InterpolatingFunction

I want a function to extract part of a one-dimensional InterpolatingFunction, similar to how Take works on lists. Based on the ...
Chris K's user avatar
  • 20.2k
2 votes
3 answers

How to deal with this list problem?

Now, I want to write a function for some kind of list. The input list includes many integers. Take a simple example for f[x], ...
Orders's user avatar
  • 1,247
16 votes
8 answers

How to avoid procedural loops in this example?

I want to iterate over a list, and return the index as long as I found the first element satisfying my condition. Written in a for loop: ...
Nick's user avatar
  • 390
14 votes
3 answers

TimeSeries interpolation with time gap awareness

Is there an option for ResamplingMethod (or any other practical way) for specifying different behaviours of the interpolation, depending on, for instance, closest dates (on the ...
P. Fonseca's user avatar
  • 6,665
156 votes
9 answers

General strategies to write big code in Mathematica?

I think after six months of exposure to Mathematica and the Wolfram Language I am fairly OK with writing short codes and snippets. However, what are some general strategies to use in order to write ...
Ali Hashmi's user avatar
  • 8,960
14 votes
4 answers

Fast Selections Testing on Inequality

Is there a functional idiom for fast selections testing on inequality? For example, finding values from list a & b where the key is less than or equal to a value, in this case 4 or 9. An ...
Chris Degnen's user avatar
  • 30.9k
15 votes
3 answers

Is there a built-in function to do binary search?

Is there a built-in function to do binary search? Say, given a list (sorted) and a number, find the position which keeps the listed sorted when the number is inserted. I know that ...
MMM's user avatar
  • 643

15 30 50 per page