# 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.

102 questions
Filter by
Sorted by
Tagged with
1 vote
67 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 ...
54 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: ...
1 vote
77 views

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

I've got the following mathematica code: ...
79 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 : ...
169 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 ...
• 145k
150 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 ...
• 55
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 ...
• 164
1 vote
113 views

### How does Indexed work in terms of sparse array

I want to use indexed given that s is an element [0,500] but I am unsure how to write that without getting a format error or a tensor error. ...
• 11
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?. ...
• 19
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 ...
• 3,633
279 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 ...
970 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 ...
• 777
1 vote
250 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 ...
• 115
116 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 ...
• 1,883
1 vote
253 views

### Create list of values with arbitrary index and the use it in a function

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. ...
728 views

### Sum over multiindex

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 ...
20 views

### Why do I have to index my covariance matrix as if it has 3 dimensions [duplicate]

The language reference for getting parts of a matrix seems to make sense. I'm wondering why my covariance matrix behaves differently. ...
• 101
121 views

### ParallelDo with doubly-indexed iterators

What is the reason that ParallelDo works with singly-indexed iterators, but not doubly- or more-indexed iterators? For example, the code ...
48 views

### Defining list of data

I need to define a list of parameters A[i] where i runs from 1 to some integerN. The ...
126 views

### Algorithm for Swapping indices and simplifying the summand in a double sum [closed]

Say we have something like $$\sum_{p}^N\sum_{q}^N \cos(p) \sin(q) - \cos(q)\sin(p)$$ usually, in the case like this, the indices p and q can be swapped, and the sum simplifies to 0. I have an ...
• 121
676 views

### Indexing nested list with another list

So I'm wanting to index the sublists within a list using another list. So I have x = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}} And I want the 2nd term of the first ...
• 175
1 vote