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 create an empty matrix in R?

I am new to R. I want to fill in an empty matrix with the results of my for loop …

r matrix na
Numpy matrix to array

I am using numpy. I have a matrix with 1 column and N rows and I want to get an array …

python arrays matrix numpy
Vector of Vectors to create matrix

I am trying to take in an input for the dimensions of a 2D matrix. And then use user input …

c++ vector matrix
Apply a function to every row of a matrix or a data frame

Suppose I have a n by 2 matrix and a function that takes a 2-vector as one of its arguments. I …

r function matrix apply sapply
How to get element-wise matrix multiplication (Hadamard product) in numpy?

I have two matrices a = np.matrix([[1,2], [3,4]]) b = np.matrix([[5,6], [7,8]]) and I want to get the element-wise product, [[1*5,2*6], [3*7,4*8]], equaling [[5,12], [21,32]] I …

python numpy matrix matrix-multiplication elementwise-operations
What does the error "arguments imply differing number of rows: x, y" mean?

I'm trying to create a plot from elements of csv file which looks like this: h1,h2,h3,h4 a,1,0,1,0 …

r csv matrix plot ggplot2
how does multiplication differ for NumPy Matrix vs Array classes?

The numpy docs recommend using array instead of matrix for working with matrices. However, unlike octave (which I was using …

python arrays numpy matrix matrix-multiplication
Convert a matrix to a 1 dimensional array

I have a matrix (32X48). How can I convert the matrix into a single dimensional array?

arrays r matrix
Inverse of a matrix using numpy

I'd like to use numpy to calculate the inverse. But I'm getting an error: 'numpy.ndarry' object has no attribute …

python numpy matrix
java Arrays.sort 2d array

I am looking to sort the following array based on the values of [][0] double[][] myArr = new double[mySize][2]; so for …

java arrays sorting matrix