# All Questions

495 questions
Filter by
Sorted by
Tagged with
74 views

84 views

### Joining $4 \times 1$ vectors defined through functions to form a $4 \times n$ matrix

I define a $4x1$column vector through a variable as: Z[i_]:=List[{a[i]},{b[i]},{c[i]},{d[i]}] I then want to make a $4\times n$ matrix by joining a specified ...
448 views

### How to join many columns of data in array?

I have large number of columns of data. How to put in single matrix? For example, with test data of 1 x 3 matrixs ...
43 views

### Selecting from a matrix according to elements of a column — efficiency and speed?

I need to select all elements from matrix M that have in their 3rd column elements from some given list L (3rd column and L are real numbers). I have written the most obvious (to me) command to select ...
805 views

### Set every element to zero in matrix unless it's 1 or 1/2

I have the following code: ...
36 views

### Add value to nonzero elements of symbolic matrix

I would like to add a certain placeholder O to any nonzero element of a matrix. The matrix has elements which are not number but complicated symbolic expressions. ...
119 views

### Indices of nonzero rows in a sparse array

Given $A\!\in\!\mathbb{Z}^{m\times n}$ stored as a=SparseArray[{...},{m,n}], how can I obtain the list of all indices $i\!\in\!\{1,\ldots,m\}$ for which the $i$-th ...
145 views

### Fast element-wise division of matrix, generated from vector with Outer, and another matrix

m = {a, b, c}; n = {{e, r, t}, {y, u, i}, {g, h, j}}; k = Outer[Divide, m, m]; k/n gives ...