Questions tagged [indexing]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
5 votes
1 answer
145 views

Creating a list of conditions

I am trying to create a list of conditions using Table[] in the following way: ...
user avatar
  • 1,063
1 vote
0 answers
88 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 ...
user avatar
  • 113
4 votes
1 answer
101 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_ ] := ... ...
user avatar
  • 1,032
0 votes
1 answer
45 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 ...
user avatar
2 votes
0 answers
138 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 ...
user avatar
18 votes
1 answer
347 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.6k
4 votes
2 answers
156 views

Selecting elements of sublists or reshaping a list of lists

I have this list ...
user avatar
4 votes
2 answers
69 views

Reduction of nested association based on criteria

I have a nested association of the following form: ...
user avatar
  • 113
3 votes
0 answers
113 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 ...
user avatar
  • 229
1 vote
1 answer
81 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, ...
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 ...
user avatar
  • 165
1 vote
1 answer
48 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 ...
user avatar
  • 187
1 vote
0 answers
85 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.
user avatar
6 votes
1 answer
165 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 ...
user avatar
  • 117
2 votes
1 answer
110 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 ...
user avatar
  • 119
0 votes
1 answer
67 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 ...
user avatar
  • 185
1 vote
1 answer
53 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: ...
user avatar
2 votes
2 answers
69 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 ...
user avatar
6 votes
2 answers
184 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, ...
user avatar
6 votes
2 answers
328 views

Contracting indices in lists

Using an answer to this question (Working with Dirac Gamma Matrices using FeynCalc - A simple problem), I defined ...
user avatar
  • 73
2 votes
1 answer
224 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. ...
user avatar
  • 111
4 votes
1 answer
74 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 ...
user avatar
1 vote
1 answer
65 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 ...
user avatar
6 votes
4 answers
368 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,377