Top "Matrix" questions

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

How to define a two-dimensional array?

I want to define a two-dimensional array without an initialized length like this: Matrix = [][] but it does not work... I've …

python matrix syntax-error
How do I find the length (or dimensions, size) of a numpy matrix in python?

For a numpy matrix in python from numpy import matrix A = matrix([[1,2],[3,4]]) How can I find the length of a …

python matrix numpy
numpy matrix vector multiplication

When I multiply two numpy arrays of sizes (n x n)*(n x 1), I get a matrix of size (n …

python arrays numpy vector matrix
R memory management / cannot allocate vector of size n Mb

I am running into issues trying to use large objects in R. For example: > memory.limit(4000) > a = matrix(…

r matrix vector memory-management r-faq
Subscript out of bounds - general definition and solution?

When working with R I frequently get the error message "subscript out of bounds". For example: # Load necessary libraries and …

r matrix sna
Select rows of a matrix that meet a condition

In R with a matrix: one two three four [1,] 1 6 11 16 [2,] 2 7 12 17 [3,] 3 8 11 18 [4,] 4 9 11 19 [5,] 5 10 15 20 I want to extract the submatrix whose rows have column three = 11. …

r select matrix submatrix
Sum rows in data.frame or matrix

I have a very large dataframe with rows as observations and columns as genetic markers. I would like to create …

r dataframe matrix rowsum
How do I iterate through each element in an n-dimensional matrix in MATLAB?

I have a problem. I need to iterate through every element in an n-dimensional matrix in MATLAB. The problem is, …

arrays matlab matrix multidimensional-array iteration
How do you rotate a two dimensional array?

Inspired by Raymond Chen's post, say you have a 4x4 two dimensional array, write a function that rotates it 90 degrees. …

algorithm matrix multidimensional-array
Convert a 1D array to a 2D array in numpy

I want to convert a 1-dimensional array into a 2-dimensional array by specifying the number of columns in the 2D …

python arrays matrix numpy multidimensional-array