Questions on filtering or selecting data based on certain criteria. This is to be used with primary tags such as list-manipulation, string-manipulation or signal-processing, with the primary tag indicating the specific use case.

learn more… | top users | synonyms (1)

0
votes
1answer
35 views

Filter pattern from a list

I have group elements, that I'd like to condense down according to group rules. Take the modular group. This has generators $S,T$ that satisfy the groups relations $S^2 = I, (ST)^3 = I$. So given a ...
0
votes
1answer
31 views

Picking some elements of a matrix and generating another matrix [duplicate]

If we have a nested matrix as: start={ {{1, 2, 2, 3}, {1, 1, -2, 1}, {3, 2, 2, -I}, {1, 2, 0, -I}}, {{3, 4, 4, 0}, {1, 1, 4, 1}, {3, 3, 4, -1}, {1, 1, 2, I}} } ...
2
votes
1answer
36 views

wrong result of an iteration related to replacement and comparing

We have two nested matrix and a code for replacement following an equality as: ...
15
votes
5answers
613 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 ...
1
vote
1answer
35 views

Choosing sets from Subsets[list] part 2

Piggybacking off of this question, say if I wanted to exclude sets which weren't the union of elements of the list of lists. For example: ...
5
votes
5answers
146 views

Choosing sets from Subset[list]

Say I have a set, S, and I take Subsets[S] (the power set of S). For example: S={a,b,c} Subsets[S]={{}, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}} How can ...
1
vote
0answers
48 views

Select complex mutiple row

How can I make this select on Mathematica? Is possible?
2
votes
2answers
48 views

Remove an element of a list [duplicate]

I want to check if any element of a list contains Missing["NotAvailable"] If so I want to delete the entire list. If I am correct I need to have some ...
1
vote
1answer
89 views

Manipulating Some Lists in Compile

Consider a list of lists, such as: Z={{1,4,3},{2,1,3},{3,1,4}} Z is an $n \times n$ matrix (here $3 \times 3$) which ...
7
votes
2answers
143 views

Get association element that has a parameter

Say I have an Association of the form: assoc = <|first->"abc", second[param]->"xyz"|> Now to access ...
6
votes
5answers
138 views

Simple Enumeration of Coin Tosses

How do I enumerate a sample space with up to 6 coin tosses where 4 Heads ensures a win. For e.g {HHHH},{HTHHH},{TTHHHH},{HTTHHH} etc.I tried the following but I do not know how to do a variable length ...
1
vote
0answers
39 views

select year 2014 from an object [closed]

could you help me to filter the year 2014 from the following object: data={{2013.09.17, 60.},{2013.10.07, 100.}, ...... } Basically I just want to select one ...
6
votes
3answers
71 views

Using Select on a 2d table with a criteria that accepts 3 parameters

I have a table sets := Table[{i, j, k}, {i, 1, 10}, {j, 1, 10}, {k, 1, 10}] and I want to use a function that accepts three parameters and returns a boolean, as ...
2
votes
3answers
153 views

select from a list of disks

I have the following list of centers of disks. ...
0
votes
0answers
28 views
2
votes
0answers
44 views

Performance of different Count patterns

The two pieces of code below are functionally equivalent, and I would have expected similar performance. (The only difference between the two is the form of the pattern used.) But the second piece of ...
4
votes
6answers
403 views

Remove the odd element from a list

I have a list, which contains more lists with elements, see example {{1, 1, 1, 1, 2}, {2, 2, 2, 2, 3}, {3, 3, 3, 4, 3}} I want to remove num 2 from the first list ...
3
votes
2answers
109 views

With “named row” nested Datasets: How to Select or Filter rows by row key with criteria from another Dataset?

After some calculations and grouping I have a Dataset similar to the following form: ...
7
votes
3answers
205 views

Deleting any list that contains a negative number

We had another nice question in a student activity today. The increasing sequence of positive integers $a_1,a_2,a_3,\ldots$ has the property that $$ a_{n+2}=a_n+a_{n+1} \text{ for all } n\ge 1. $$ ...
1
vote
2answers
192 views

How to speed up a For-loop [closed]

My code is the following: ...
5
votes
0answers
109 views

How to implement a Kalman Filter

Below I use low level code to reproduce the example of a Kalman Filter on pages 16-20 found here. First I create the data. ...
1
vote
2answers
91 views

Get value from InterpolatingFunction

I'm trying to find My[t], Mx[t] and Mz[t] values when evaluated at ...
1
vote
1answer
35 views

Select on 3D-table along diagonal

I have the following data set on the form (x, y, z) ...
7
votes
6answers
373 views

How to select sub-lists having at least one element that matches a pattern

This will probably be a very easy question, yet although I did find a relatively similar one, I couldn't use the answers there to solve my problem (I'm still a novice). I'm simulating 10 blocks of ...
3
votes
1answer
114 views

Using Select with Alternatives

I want to select the elements of a list like: ...
4
votes
2answers
89 views
14
votes
4answers
285 views

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 ...
4
votes
1answer
201 views

Select elements of list

I have a list of lists list={l1,l2,l3,l4,...}; and two elements e1,e2. I want to select from lists ...
3
votes
4answers
158 views

Filtering the close values from the list?

I found some difficulty to flatten the data. Let's say we have a list such that, list={-0.0223, -0.0199, -0.0195, -0.0159, -0.0159, -0.0122, -0.0126} You can ...
3
votes
1answer
55 views

How does levelspec work inside Position?

Please, can you explain the following feature of levelspec inside Position ? This code test=Range[5]; Position[test,x_/;x>2] as expected, gives ...
3
votes
0answers
63 views

Application of lowpass Butterworth filter

I'm trying to design a Butterworth lowpass filter with a cutoff frequency of So far what I did is ...
3
votes
2answers
83 views

How can I filter a permutation list depending of a pattern? [closed]

I've created a permutation list Grid[Permutations[{a, e, q, r, t, u}], Frame -> All] and only want to see rows where the 5th element is a "t". I tried to do ...
3
votes
0answers
32 views

commutative matching

I've been doing some work that results in the creation of hundreds or thousands of equations with the same answer. To prevent them from collapsing to their simple answers, each has been passed through ...
6
votes
3answers
140 views

Filtering lists by partial matches

Suppose I have the following data: ...
2
votes
2answers
206 views

Why does the `LowpassFilter` shift the data?

I applied the LowpassFilter to my data and it shifted the result. Why is it? How can I filter high frequency oscillations without the shift? ...
0
votes
0answers
78 views

How does KalmanEstimator update the Kalman gain, process noise and state variable mean?

The first "Application" in the documentation for KalmanEstimator is copied below with additional variables for clarity. ...
2
votes
0answers
65 views

We need to know the input signal when we use KalmanEstimator?

The first "Application" in the documentation for KalmanEstimator is copied below with additional variables for clarity. ...
3
votes
0answers
50 views

What are all the elements of the expression returned by KalmanEstimator used for?

The first "Application" in the documentation for KalmanEstimator is copied below with additional variables for clarity. ...
4
votes
1answer
41 views

Failure in use of SetPrecision with Filter

I am working with a narrow band filter and I wish to use a high precision version. The filter is defined using Integers with Laplace variable s. Here is the, rather horrific, equation: ...
0
votes
1answer
57 views

Using Select function to select elements based on last element of nested list [closed]

Good morning, I have a list with each element containing a tuple and a single. It is of this form: ...
7
votes
1answer
145 views

Why the BandpassFilter is different than applying LowpassFilter then HighpassFilter

If I generate some data with noise, and use a filter to filter the noise, why does BandpassFilter not produce the same results as using ...
6
votes
1answer
193 views

Smoothen the curve found by EdgeDetect

It seems that curves found by EdgeDetect always persist $C^{0}$ continuity only. Consider the following example: ...
4
votes
3answers
165 views

How to find points along the inner and outer edge of a ring along a specific direction

I have a set of random numbers distributed on a annular disk. I want to find points on the inner and outer edge along a particular angle. One possibility is to use ...
6
votes
1answer
206 views

How to make sense of LowpassFilter, SampleRate and the cutoff frequency ωc in different Mathematica versions?

How do you make sense of the scale of "time" and "sampling" when using LowpassFilter and SampleRate ? Given the test data with ...
1
vote
1answer
67 views

Pure “Select” function over matrix

I have several lists of tuples in the following shape: l1 = {{1, 134}, {2, 314}, {3, 164}} I do want to select, from each list, list elements fulfilling a ...
0
votes
1answer
42 views

How to extract an association with similar keys from another association?

Considering we have an association like: ...
2
votes
1answer
135 views

Why is there a difference when formulating patterns for Select and FirstPosition?

Select[{1, 2, 4, 7, 6, 2}, # > 2 &] Gives {4, 7, 6}. OK! So one should think that the following would work: ...
1
vote
5answers
149 views

Select using MemberQ

I want to make a selection on this list ...
3
votes
5answers
145 views

How to filter list of list of rules on certain condition?

For example, Solve[] returns all solutions as a list of list of rules. And mine looks something like this: ...