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

80 questions
Filter by
Sorted by
Tagged with
75 views

### Index of item inside StructuredArray

How do I extract position of item in StructuredArray without converting using Normal? The following code finds the position of ...
117 views

### Split matrix expression into multiple lines

Given a matrix expression testm = {a + b, c + d, e}; {# , testm[[ # ]] // Simplify} & /@ Range[ Length[testm] ] // MatrixForm \begin{equation}\begin{pmatrix} ...
46 views

### Fancy Indexing of a 4D array (tensor)

I'm trying to mimic the CoefficientArrays function, which I can't get to work for my symbolic equations. The CoefficientList ...
94 views

### How to get the class of neighbors in a 2D periodic matrix?

I'm trying to analyze the spatial structure of some rectangular arrays by counting the number and class/type of neighboring points around every point in the arrays, with periodic boundaries. For ...
86 views

### Labeling elements of a table

I have a table of the form(the table is very long, i put an example): tab1={{{1,10,30},{1,20,54},{1,30,65}},{{2,10,35},{2,20,65},{2,30,70}}} How can I give ...
70 views

### How do I evaluate my functions over a range of values? [closed]

I want to use the list of data which will come from MapData1 (in code); the first element is θ and second is Action(I). I want to use this Action(I) and Angle(θ) in ...
55 views

### Efficiently get positions of Query results

I have some very large Datasets. Is there any efficient method of getting the positions of results found in a Query? That is, without using ...
33 views

### Arrange exceptions in a list by some criteria

I have some dataset, which is supposed to have $30000$ in the last column, and I want to find the elements that break this, and arrange them numerically while mantaining the index. What I'm currently ...
67 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. ...
217 views

498 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 ...
656 views

### Finding the x-value corresponding to a y-value found using Nearest [closed]

I have a large 2d array of infinite precision named "data" of x values and y values. I am using Nearest to find the y-value closest to a specified number, say 0....
126 views

### subscript index notation select certain value [closed]

I have an indexed variable Subscript[p, s, m, t] established using the Notation method. There are various expressions where s, <...
54 views

### Part[] for multi-index array [duplicate]

If I want to set element (i,j) of two-dimensional array X to 0, I can write X[[i,j]] = 0. My question is how can I achieve this if I have the indices i and j in a ...
449 views

### Add Index to All Elements of a List

My goal is to add an index to all elements of a list in the form {"a", "b", "c", ... }, so it becomes ...
782 views

### How to use the value returned from Position as index for another list? [duplicate]

say, I want to find an index of a specific element in a list using Position[{a, b, c, d, e, f}, c] and it returns {{3}} How ...
583 views

### Getting error messages during double summation [closed]

I have two lists xi and ai of equal length, n. I would like to perform a sum over the ...
58 views

### Condition on the index of an element $a_{i,j}$

This question may seem to be easy. But I did not find the right way after several attempts I need to put a condition in general for $a_{i,j}$ ,If the i is bigger ...
122 views

### Using sparse matrices when value depends on position

I am working with solving a linear system that becomes a tridiagonal matrix. In order to speed up the process for large matrices, I want to use sparse matrices. My problem is that the values are not ...
153 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 ...
2k views

### How to parse JSON

please forgive me if this is obvious, but I have some JSON: ...
233 views

### contraction of indexes takes long time

I have got an expression which has more than a hundred terms being added up together, each of terms are similar in mathematical form....
212 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 ...
45 views

### How can I retrieve an element of an array created with Range? [duplicate]

I have the following Mathematica code where I create a linearly spaced array of numbers and try to retrieve the third element: ...
202 views

### How to map functions twice?

I would like to plot multiple lists. The table looks like a={{1,2,3,0,0,0,0,0,0},{1,2,3,0,0,1,0,0,0},{1,2,3,0,0,0,2,0,0},...,{1,2,3,0,0,0,0,3,0}} I want to plot ...
966 views

### How to set variable from imported data

I have an excel file i would like to import as data in mathematica with 3 columns like below: Column 1: the nodal numbers Column 2: the values of mx Column 3: the value of mxy Once ive imported the ...
325 views

### Using a set of indices to select a subset of an array

Let's say I have a 1D array a, I can use a list of indices b to select a subset of that array: ...
220 views

### Slicing an Association with named key span without normalizing?

Is there way to slice an Association with named key span? Span currently doesn't accept named keys: ...
53 views

### How to use Table function with two parameters executed when they are not equal? [duplicate]

I have a list, param2 = { {-qlim, -qlim}, {-qlim, qlim}, {qlim, -qlim}, {qlim, qlim} }; and want to get combination of them with, ...
911 views

### define variable index

im in the medal of coding and i reached the point where i have something like this, the problem is i have up to 35 terms and all should be index in order to preform summation to count all ...
42 views

### Fast list update using list of indices with repetitions

I want to update a vector like this: list = {0, 0, 0, 0}; updval = {1, 1, 1}; updind = {2, 2, 3}; list[[updind]] += updval; list The result is ...
258 views

### What's wrong with the Sum function?

Here are the codes: ...
212 views

### Assigning Values of Indexed Variables to Arrays

New to mma. I have assigned the results of using Solve to solve 5 variables to 5 indices of a new variable: ...