Questions tagged [searching]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
3 answers
245 views

How to find the nearest string to another string in a mixed array

I am trying to find which string is nearest to another string in an array of numbers and strings. For example, say I have an array that is as follows ...
user avatar
  • 45
11 votes
3 answers
179 views

Faster searching for subsets with pairwise conditions

I am looking for a faster way of finding large subsets of lists that obey pairwise conditions. In particular, I'm looking for a large (over 10k) set of quaternary words (i.e. ordered lists) of length ...
user avatar
  • 30.3k
1 vote
2 answers
73 views

How to search a directory of nb files for a string?

I would like to find a particular string in a set of nb files in a directory but am having problems interpreting the results of my code. Here's a simple example: In directory d:\mathematica, I have ...
user avatar
  • 1,094
0 votes
0 answers
47 views

How to search exact product title with ServiceExecute

I am trying to find the exact product title having phrase "HEPA filter bags" on "amazon.com" but it doesn't return the correct result. ...
user avatar
  • 125
0 votes
0 answers
50 views

Finding minimum in a list of lists

Imagine I have the following list {{0, {2,3}}, {-1, {5,3}}, {2, {2,6}}, {5, {5,0}}, {0, {1,1}}, {-2, {10,2}}, {3, {4,2}}}; I want to pick the element in the list ...
user avatar
  • 4,138
3 votes
1 answer
37 views

Position doesn't work for custom symbol within package

In a notebook, I can easily search an expression for a custom symbol. In[237]:= Position[{mySym, 1, 2}, mySym] Out[237]= {{1}} However, if I write a function and ...
user avatar
0 votes
1 answer
137 views

Implementing an optimization algorithm in WL

I am trying to implement the Jaya optimization algorithm (Jaya). This is a flowchart from the Author 's webpage showing the details of the Algorithm. Note that there is a typo in the equation in the ...
user avatar
1 vote
1 answer
80 views

Pattern Matching in 2-dimensional lists

How would I search for all the elements in a nested list which contain values at specific index? For example, I want to search for and return all the elements in a (n,2) list which begin with a 3 ({3, ...
user avatar
0 votes
1 answer
101 views

Import structure from Matlab into Mathematica 12 and nested lookup

I use Matlab and generate data that I save in a structure in a MAT file. I want the results to be loaded into Mathematica, as several analysis and plots are best when done in the latter than in the ...
user avatar
18 votes
1 answer
343 views

Intelligent text search on large directories of notebooks?

I have a (deeply nested) directory containing 10s of thousands of wolfram files (mostly notebooks (nbs), but also scripts (.wls), packages (.m, .q wl), my and wxf data) and many subfolders each with a ...
user avatar
  • 30.3k
2 votes
3 answers
198 views

Cases do not pick up Sqrt?

I'm trying to understand how Cases work in Mathematica, and I'm a bit curios why i't wont pick up the Sqrt function? Consider the following expressions ...
user avatar
0 votes
1 answer
31 views

Search for terms contatining error functions

question might have an answer in this post (Efficient Search for specific Terms in symbolic Expression) but i don't understand how to convert it to my specific case Through some definite integrals I ...
user avatar
2 votes
2 answers
92 views

Finding Mnemonics for expressions with lots of indices

One of the equations I work with in my research are the pentagon equations: ...
user avatar
  • 928
3 votes
1 answer
178 views

Find words in a messed up table [duplicate]

This table with a caption that said "First three words you see will come to you in 2021" inspired me to do some digging: Imagine that we have a table with randomly filled letters. How can ...
user avatar
  • 789
9 votes
2 answers
665 views

Solving a rotating combination lock puzzle

The following puzzle appears in The House of da Vinci II and I thought it might be interesting to tackle in Mathematica: There are numbers marked on four rotating cylinders. These numbers must add up ...
user avatar
  • 20.4k
2 votes
1 answer
75 views

How to search for special `ResourceFunctions`

In Mathematica there exist several very useful Resource functions , for example ResourceFunction["MeanCurvature"] and ...
user avatar
3 votes
2 answers
135 views

Find position of sublists containing a given element at nth position

I have a list of lists similar to this: L = {{"a", "b", "c"}, {"x", "c", "y"}, {"i", "j", "h"}, {"x", "b", "z"}} Each list within ...
user avatar
  • 1,303
0 votes
1 answer
43 views

Find parameter value for which sharply-peaked constrained 3d-integral equals 1

I want to find the value (desirably to high-precision) of the parameter $i$ for which the constrained 3d integration ...
user avatar
0 votes
1 answer
50 views

Searching across multiple notebooks for given list of functions / symbols

Is there a method to search across multiple notebooks for each in a given list of function or symbol name? The input should be a list of function or defined symbols, and the output would be an ...
user avatar
  • 14.8k
2 votes
1 answer
275 views

Search for squares

Could anyone please help me find $a\left(x,y,z\right)$, $b_{i}\left(x,y,x\right),$$c_{i}\left(x,y,z\right)$ and $d\left(x,y,z\right)$ that are sums of squares of polynomials or rational functions such ...
user avatar
  • 21
2 votes
2 answers
63 views

How to find the primitive Heron triangles with three rational angle-bisectors by MMA?

I'd like to find the primitive Heron triangles with three rational angle-bisectors. In a Chinese book, I saw these primitive Heron triangles with three sides no longer than 1000, but I'm not sure if ...
user avatar
  • 175
4 votes
3 answers
457 views

How to find the position of the smaller element in the list

x = {4, 1, 2, 5, 6, 7} y = {1, 2, 4, 5, 6, 9} There are two lists x and y. How to find out these positions of the elements in list x are smaller than those in ...
user avatar
7 votes
4 answers
770 views

Find elements of array with largest absolute value

I am wondering how to do in Mathematica the following: Given as an input a large array, I want to output a list of top $n$ entries with largest absolute value + their location within the array. ...
user avatar
1 vote
1 answer
72 views

How to test if $ⅈ$ is in an expression?

From this answer https://mathematica.stackexchange.com/a/9773/68791 and according to the documentation: FreeQ[list,form] test whether form occurs nowhere in ...
user avatar
0 votes
1 answer
69 views

Search for certain entries in an expression

I have a list with large expressions. I would like to find certain functions and their derivatives by searching the list. The search outcome should be the functions/derivatives found only, not the ...
user avatar
  • 265
5 votes
2 answers
456 views

Implementing a Better Grep Command

In Working With String Patterns, Wolfram documentation yields a simple Grep function: ...
user avatar
  • 2,975
6 votes
4 answers
355 views

How to search within notebooks on Windows 10?

I have a lot of notebooks scattered in my downloads, documents and desktop folder. I have all the required locations on Windows indexing options but if I look at Advanced Options and File Types and nb ...
user avatar
  • 8,105
3 votes
3 answers
160 views

Find element in a list matching a pattern (using wildcards)

Somehow, I did not manage to find anything related to that. Suppose, in my Global list of variables, I would like to make a search such that I obtain all the ...
user avatar
  • 951
4 votes
3 answers
99 views

Subsequence Search

I need to parse some xml code. I need to extract some values withing pattern elements. I made an example of my trouble. Here is some complicated xml list: ...
user avatar
4 votes
3 answers
183 views

Find non-case sensitive string in a mixed list of elements?

Consider an example list with mixed element types, e.g.: list = { 1.234 , a[2] , {"Abc" , 4/5} , "acb" }; I would like to have a function that finds the position ...
user avatar
  • 11.5k
2 votes
0 answers
41 views

Match an expression that has a descendant pattern

I have a complicated expression in which I have another expression p which, when it’s present, I want to match the outer expression and all of its children. I was hoping for something like ...
user avatar
  • 471
2 votes
0 answers
55 views

Is there a way to cancel a search in Mathematica?

Is there a way to cancel a word search in Mathematica initiated via the Find and Replace menu?
user avatar
3 votes
0 answers
203 views

Approximate Nearest Neighbors in Mathematica?

Is there any support for Approximate Nearest Neighbors (ANN) in Mathematica or third-party packages? I'm looking for a good implementation of locality sensitive hashing for applications where ...
user avatar
  • 30.3k
5 votes
4 answers
510 views

Find permutation index

Firstly I wanted to find all the non-negative integer solutions for the following equation given the value of $k_{max}$ $$ k_1 +k_2 +k_3+k_4 = k_{max} $$ For this I use the following code:- ...
user avatar
  • 3,564
0 votes
1 answer
46 views

Problem using Position when using a variable [closed]

So, I tried to use Position to get the Position of the 90% Maximum of a Photodiode Signal. The code works when i directly use the solution of the .9*Max[...] solution, but I want to have it with a ...
user avatar
  • 1
0 votes
1 answer
552 views

Using the binary search algorithm in a sorted grid

I want to get a mathematica code for binary search algorithm applied to a sorted grid containing integers. For example, given f[k_,x_]= x^2 + k x + k - 2 where <...
user avatar
5 votes
1 answer
112 views

How to speed up a text search widget?

I have an InputField that searches a predefined list for matching strings and displays them in a TextGrid. But when the list is ...
user avatar
  • 30.3k
7 votes
1 answer
151 views

How to cache results of WebImageSearch?

Every call to WebImageSearch costs money (wolfram service credits), thus, I would like to page through results without having to redownload them. Given the ...
user avatar
  • 30.3k
0 votes
2 answers
54 views

Looking for specific data in .txt file

I've the following code: Import["test.txt"] And it gives me: 1,10 2,20 3,30 4,40 5,50 6,60 7,70 8,80 9,90 10,100 11,110 12,120 13,130 14,140 15,...
user avatar
  • 277
0 votes
1 answer
32 views

Searching in a .txt file for a specific time

I've the following code: Import["hoi1.txt"] And it gives me: "(time,voltage,current,power) (1,10,5,10*5) (2,20,6,20*6) (3,30,7,30*7) (4,40,8,40*8) (...
user avatar
  • 277
4 votes
4 answers
191 views

How can one efficiently find the (x,y) values of the rectangles that enclose a chosen % of nonrandom data points in mathematica?

A half hour of searching for answers did not give useful results. This is typical data: I need to find the (x,y) values of at least 6 rectangles with one corner at (0,0) and the opposite corner at (...
user avatar
4 votes
0 answers
190 views

Extracting names (surname & family name) from unstructured text files

This question is about finding names of people in a text without knowing these people. There are some rules we can use to detecting names in a text A name consist always of two or more words (...
user avatar
6 votes
4 answers
329 views

Searching for an unordered triple in a list of triples

I have a list of triples which looks like this T = {{7, 1, 2}, {7, 2, 3}, {7, 3, 8}, {7, 1, 6}}; (I have suppressed a few triples for clarity. My real list is ...
user avatar
2 votes
2 answers
150 views

Efficient Search for reverse element in List of Lists

I have a big list AllCycles with contains lists of non-repeating integers (and the first element is always the smallest). I want a function ...
user avatar
  • 2,062
10 votes
1 answer
355 views

How can I implement my own documentation search function?

The current documentation search doesn't allow for very sophisticate searching, can I write my own function to search through the docs?
user avatar
  • 45.4k
2 votes
0 answers
112 views

dynamic binary search

Suppose I have a time series of values $v_1, \dotsc, v_n, \dots,$ (think of the data as being generated by repeated function calls, like a Python generator, or being captured in real time) and I want ...
user avatar
  • 4,974
4 votes
2 answers
318 views

Obtaining the position in a list where the i^th element is bigger than the (i+1)^th element

My question is very simple but I am not able to find the optimal solution. What I am trying to do is to have a function that give me the position in a list at which the value at position ...
user avatar
  • 349
3 votes
0 answers
60 views

How to find where in a large expression Power::infy is generated?

Consider the following expression: ...
user avatar
  • 6,912
2 votes
2 answers
120 views

Memoization and finding already calculated DownValue

The problem of plotting an expensive function discussed in this question caught my attention. As an exercies I tried to solve it using memoization as follows ...
user avatar
  • 987
7 votes
3 answers
324 views

Find sublists in a list by contents, then union them

I want to find two sublists in a list by an element they contain, and then union them, keeping them in the list. I have this code that seems to do the job, but it seems rather clunky. Is there a ...
user avatar
  • 817