Questions tagged [indexing]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
1 answer
59 views

Generating a List of Indexed Variables with "=" sign [closed]

I want to generate variables in the form of: r1 = number, r2 = number, r3 = number, etc The 'numbers' are not necessarily the same and come form a previous calculation. This is what I have: ...
fiz's user avatar
  • 676
2 votes
2 answers
89 views

Symbolic Indexing on Symbolic Arrays

Is there a way to use symbolic indices on symbolic vectors? The most barebones example I can think of is the following: aV = Array[a,3]; aV[[m]] which evaluates to ...
ertl's user avatar
  • 121
4 votes
2 answers
251 views

Enumeration of a nested list

My problem is consisting of following: I have a nested list of following form: {{B, v ** v, b ** B}, {b, B ** b}, {b ** B, v ** v}, {}} And I want to enumerate ...
George's user avatar
  • 69
1 vote
1 answer
74 views

Indexed array cannot be named by the name of its elements

Indexed Arrays or lists can be created by Array[k,3] (*{k[1], k[2], k[3]}*) However I would like to name this list also by k, i....
granular bastard's user avatar
1 vote
0 answers
83 views

Comparing two texts, looking for matching phrases

I would like to compare two human-language, user-supplied texts. Call them Text A and Text B. Each is the length of a fat novel, i.e., around 150,000 words. Is there a tool that can help me find all ...
du_toit's user avatar
  • 11
5 votes
1 answer
248 views

Creating a list of conditions

I am trying to create a list of conditions using Table[] in the following way: ...
JEM's user avatar
  • 1,165
1 vote
0 answers
147 views

How to index a Table of Lists? [closed]

SOLVED: Thanks to Daniel below, I should index as expected as [[All,All,1] for er etc. My mistake came as I was trying to index from 0, which Mathematica does not like! I've spent a while reading ...
D. Brown's user avatar
  • 304
4 votes
1 answer
106 views

Search speed of downvalues when indexing with strings

I'm writing a lot of print functions for different parts in a package and at the moment am using something like myprint[ identifierString_String ][ data_ ] := ... ...
Gert's user avatar
  • 1,470
0 votes
1 answer
117 views

How can I merge indices, such as converting a $4$-index list to $2$-index matrix, $C_{ijkl} \rightarrow D_{(ik); (jl)}$?

How can I merge indices, such as converting a $4$-index list to $2$-index matrix, $C_{ijkl} \rightarrow D_{(ik); (jl)}$? This example sometimes appears in physics applications. Here, I mean $(ik)$ as ...
user196574's user avatar
2 votes
0 answers
345 views

Part::partd: Part specification is longer than depth of object (Simple list) [closed]

I know that this question has already been asked (I searched for answers), but in every thread I saw the code was much more complicated than what I'm trying to do, and I can't understand why this ...
Sara Munafò's user avatar
18 votes
1 answer
375 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 ...
M.R.'s user avatar
  • 31.2k
5 votes
2 answers
184 views

Selecting elements of sublists or reshaping a list of lists

I have this list ...
tomeq's user avatar
  • 63
4 votes
2 answers
75 views

Reduction of nested association based on criteria

I have a nested association of the following form: ...
Sven's user avatar
  • 113
3 votes
0 answers
152 views

Summation variables aren't recognised as dummy variables

I'm trying to write this expression in Mathematica, and calculate the following quantity However, when I tried the following ...
Our's user avatar
  • 229
1 vote
1 answer
179 views

Index an array with condition

I have a list like the following: list = {{1, 11}, {2, 7}, {4, 2}, {7, 9}, {-2, 1}}; I would like to select those entries whose second elements are greater than 2, ...
Lorz.Astro's user avatar
0 votes
0 answers
19 views

Indexing list returned by a function [duplicate]

How do I access elements of a list that is returned by a function? My function that returns the list is: b[x_] := (Return[{x, x/2}];) Then when I try to reference ...
gen's user avatar
  • 195
1 vote
1 answer
70 views

Computing a Transformation then visualizing with TransformedRegion Function

I have some function $\psi$, I compute the transformation $T = \vec{x} - \nabla \psi$. I'd like to visualize the action of $T$ on a square centered at the origin. The mathematica website shows some ...
yoshi's user avatar
  • 187
1 vote
0 answers
101 views

Can you create an indexed list of all Wolfram functions within a notebook? [closed]

Can you create a summary list of all Wolfram functions used within a whole notebook? Searched long and hard- no clear documentation found.
Peter Thompson's user avatar
6 votes
1 answer
266 views

Undefined Indexed Variable

I searched already a lot about indexed Variables, and it tends to be the most applicable way to use tensor notation. But I am having a hard time to solve for undefined indexed variables: Here my ...
oyy's user avatar
  • 187
2 votes
1 answer
127 views

Plot the indices of the background Matrix instead of the calculated values

I want to create a background 60*100 matrix and insert inside it the calculated values, for example ...
Shaaban's user avatar
  • 119
0 votes
1 answer
99 views

Is it possible to renumber a notebook without rerunning it?

When I prepare a notebook to share with others, I like the numbering of the code cells to start from 0 and to increment predictably to make them more readable, but the only way I know to do this is by ...
David's user avatar
  • 185
1 vote
1 answer
88 views

How does Mathematica evaluate sums where the upper limit of the index is not an integer?

I am interested in the way Mathematica evaluates sums where the upper limit of the index is not an integer - i.e., sums that are some sense mathematically meaningless. For example: ...
Richard Burke-Ward's user avatar
2 votes
2 answers
79 views

How to identify index intervals that contain a value?

I have a really simple question but, sorry, I can't seem to find an elegant solution to other than iterating through. I have a list of indices, and a relative list of values, I would like to extract ...
Yates Buckley's user avatar
6 votes
2 answers
330 views

How to create a nested list of variable depth with indexed elements

i want to obtain this definition of a nested list t = Table[C[i, j], {i, 3}, {j, 3}] with arbitrary depth, ...
Rainer Glüge's user avatar
6 votes
2 answers
484 views

Contracting indices in lists

Using an answer to this question (Working with Dirac Gamma Matrices using FeynCalc - A simple problem), I defined ...
FB20's user avatar
  • 73
2 votes
1 answer
337 views

how to add labels of points next to it based on index in ListPlot

I have a list of some points. I plotted each point and its closest surrounding points. ...
Erfi's user avatar
  • 111
4 votes
1 answer
118 views

Replace pattern with the number of matches so far

I want to replace a n-th pattern match in an expression with n. This is a very simple task, though it appears very hard to find an elegant implementation. For example, with input ...
Anti Earth's user avatar
  • 1,161
1 vote
1 answer
74 views

Sum index in function collides with input variable

When I enter the following: Clear["Global`*"] Func[f_, xx_] := Sum[D[f, xx[[s]]], {s, 1, 2}] Func[x^2 + y^2, {x, y}] Func[x^2 + s^2, {x, s}] The first function ...
meldefon's user avatar
6 votes
4 answers
439 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 ...
user13892's user avatar
  • 9,113