# Questions tagged [index]

Questions about functions with intrinsic part index such as SparseArray, Part and Indexed or iteration variable indexes such as MapIndexed, Sum and Product.

103 questions
Filter by
Sorted by
Tagged with
70 views

### Finding Minimum Hamming Distance

Given a set of vectors, $\{v_1, \dots, v_n \}$, I'd like to find their minimum Hamming Distance, $\min_{1 \leq i < j \leq n}|v_i - v_j|$. My main issue is, I don't know how to do this in ...
85 views

### A problem with indices in tensor

I want to create a tensor similar to the one shown in the first picture, but I'm encountering some issues with indices. Could anybody assist me? Here's my code: ...
103 views

### Replace elements of indexed list by list of rules

I have an array bs that contains many indexed elements b[ ]. I want to define the values of bs by a list of replacement rules. ...
1 vote
73 views

### Retrieving only first function in matrix ODE using NDSolve

I have a very stupid question, but I don't use Mathematica very often, so here it goes: I'm trying to solve some "matrix" ODE using NDSolve. The matrix in ...
422 views

### How to replace the element in list of list by its ordering index

I have a list of list: res={{9, 1, 5}, {3, 6, 12}} I want to change it to res={{5, 1, 3}, {2, 4, 6}} by following their ordering ...
1k views

### Sequentially numbering a nested list

I've got a nested list {a, b, {c, d}, e, {f, {g, h}}} which I want to magically transmogrify to ...
231 views

### How to include index for the coefficients in series or sequence

I am trying to use the "Summation" command for the exponent and for the corresponding subscript of the coefficient, but it fails. See the example below: ...
242 views

### Map a function that uses the lists indices as arguments

Suppose I have a function f[x_] that I want to Map over somelist (assumed to be one ...
2k views

### How do I find the position of the maximum value in each column of a table?

Given a table of values, I know how to find find maximum values, but how do I find the position of the maximum value in each column. For example, given ...
1 vote
80 views

### Can't use iterative variable as part specification [closed]

I've got the following mathematica code: ...
290 views

### Function over a list that depends on the index

Suppose I have a list {a, b, c, d} I want to operate on this list with a function which depends on the index of the element, e.g. I want to add the index ...
81 views

### Problem with integration with indexed variable

I wonder why I can not have a correct integration form on Mathematica with some indexed variables. Indeed, when I write : ...
123 views

### RSolve solves only one of two equivalent recurrences

I am having an issue with the RSolveValue/RSolve function. Specifically, Mathematica is able to correctly evaluate ...
1k views

### Faster position list construction from a "take instructions" list

Take some list, e.g., {1,2,3,4,5}, and a "take instructions" list, say {1,1,2,1,1}. The latter is read as "take the first ...
182 views

### How to use Position to select based on absence of a pattern?

I need to use Position to obtain positions of entries in list of lists that do not contain a certain pattern. The problem is that ...
152 views

### Substituting the element of a list into a list that contains the index position

I see similar questions for lists and indexes and manipulating with Thread, MapIndexed,etc., but I do not see how to do a substitution. I have a list of coordinates for a geometric object and a list ...
1 vote
139 views

120 views

### How would you explain Nothing[] weirdness? [duplicate]

I would like to use Nothing[] to make some elements of a list invisible. (The intended use is to remove a few unwanted points from a ...
128 views

### Integer functions indices in a sum

I have some troubles with plotted A versus p, especially for the function F(s,l,p), I don´t know how deal with the integer functions indices of the sum. How can I input such a sum to Mathematica?. ...
1k views

### Map vs. Table for index-specific operations on 2D arrays

Many experienced users on this site tend to use Map (and its variants, MapAt, MapIndexed, etc.) rather than Table. When applying the same operation to every element of an array, Map does seem more ...
999 views

### Is there an easy way to index by a binary vector / mask?

I would like to be able to extract elements from a list where indices are specified by a binary mask. To provide an example, I would like to have a function ...
1 vote
253 views

### Collecting terms from expression with indexed functions

Say I have an expansion of terms containing functions y[j,t] and its derivatives, indexed by j with the index beginning at 0 ...
117 views

### Typography of Mixed Tensor Index Notation

How can one properly and quickly write a mixed "tensor" such as $\Gamma{}_{1}{}^{2}{}_{3}$? Shortcuts such as esc Gamma esc, Ctrl+^, Ctrl+_ are prefered. I intendd to use this in an inline equation ...
302 views

### Unable to use indexed variables with NDEigensystem

I am trying to solve a system of differential equations with NDEigensystem, but there need to be arbitrarily many of them. I want to use indexed variables like a[i], which works fine with NDSolve, but ...
246 views

### How to convert span to flat list of indices?

Let sp be a Span object, and n a non-negative integer. I'm looking for an efficient way to ...
1 vote
I have the following generating functions: $l_{2i-1}=l_{1}-(i-2)(w+s)$ with $i\geq 2$ and $l_{2i}=l_{2}-(i-1)(w+s)$ with $i\geq 2$, so the first one is for odd index and the second for even index. ...
I would like to calculate a sum over some multi-indices, that follow a specific pattern. $$\sum\limits_{1\le i_1<i_2<...<i_k\le N} A(k,i_1, i_2, ..., i_k).$$ $A$ is a fix expression of the ...