Top "Matrix" questions

In mathematics, a matrix (plural matrices) is a rectangular array of numbers, symbols, or expressions, arranged in rows and columns.

Looping in a spiral

A friend was in need of an algorithm that would let him loop through the elements of an NxM matrix (…

algorithm matrix loops spiral
convert Matrix of type CV_32FC1 to CV_64FC1

How do I convert a cv::Mat of type CV_32FC1 to the type CV_64FC1 (equivalent to a change …

opencv matrix double
How can I rotate a mesh by 90 degrees in ThreeJS?

I have a mesh that I want to rotate by 90 degrees inside Three JS. Here is the image of the …

javascript matrix 3d rotation three.js
How to fill a matrix with zero (0)

I need to fill matrix distances with 0. How can I do this? distances <- matrix(1:25, nrow=5, ncol=5) apply(distances, …

r matrix zero
Reshape three column data frame to matrix ("long" to "wide" format)

I have a data.frame that looks like this. x a 1 x b 2 x c 3 y a 3 y b 3 y …

r matrix dataframe plyr reshape
Get all the diagonals in a matrix/list of lists in Python

I'm looking for a Pythonic way to get all the diagonals of a (square) matrix, represented as a list of …

python matrix diagonal
How to get mean, median, and other statistics over entire matrix, array or dataframe?

I know this is a basic question but for some strange reason I am unable to find an answer. How …

arrays r matrix dataframe r-faq
Get the indices of the n largest elements in a matrix

Suppose I have the following matrix: 01 02 03 06 03 05 07 02 13 10 11 12 32 01 08 03 And I want the indices of the top 5 elements (in this case, 32, 13, 12, 11, 10). What is …

matlab matrix
Convert matrix to 3-column table ('reverse pivot', 'unpivot', 'flatten', 'normalize')

I need to convert the Excel matrix FIRST in the table LATER: FIRST: P1 P2 P3 P4 F1 X F2 …

excel matrix pivot-table unpivot powerquery
Scale and mirror SVG object

How do I most easily first scale an object, say 2 * times it's current size and then flip it vertically and …

svg matrix scale flip