# Questions for matrix

6073

### Reduce the number of rows in a random matrix created with randn

I have a matrix like2783

### How can I put 2d array to 2d array in numpy?

I have the following code4261

### Why sometimes Bitmaps are the same objects?

In my code I'm doing something like this:2336

### Javascript matrix addition of an arbitrary number of arrays' values, without using array.map()

I'm trying to build a helper function for my AngularJS app (but the solution doesn't have to use angular.forEach). The function should take an arbitrary number of arrays with same length and add the3223

### csparse error while solving sparse system of equations

I have a task in which I have to solve a system of linear equations Ax =B, where A is a sparse matrix of the order of 10000. I am using csparse to solve it. In my initial implementation, for demo6087

### How do I create a matlab 201X 201 matrix

How do I create a 201x 201 matrix with all odd rows alternating as 3,1,3 and the even rows alternating as 1,2,1,2. I tried using a random number generator, a for loop, and am thinking about using the7867

### 3d Camera - How to Change Camera Orientation?

Say I have a world object at point W and a camera at point C. How do I make the camera point at the object?8746

### OpenCV cv::Mat 'ones' for multi-channel matrix?

When working with 1-channel (e.g. CV_8UC1) Mat objects in OpenCV, this creates a Mat of all ones: cv::Mat img = cv::Mat::ones(x,y,CV_8UC1).9863

### OpenGL MatrixModes

I can't really understand what these modes are doing.5966

### Efficiently computing element wise product of transition matrices (m*m) * (n*n) to give (mn*mn) matrix

Consider input matrices X and Y of shapes (m,m) and (n,n) respectively. As an output we need to give a (mn,mn) shape matrix such that it multiplies corresponding entries in the two matrices.5332

### Reporting/visualizing scalability results from MPI code… which would be the best way?

As part of my research, I have computed the parallel solution to different banded systems using ScaLAPACK. I am interested in reporting the achieved speedup as a function of both the rank for the m...7093

### Multiply part of an array as a matrix using matmul

My question is similar to this one Multiply a 3D matrix with a 2D matrix. However, I'm coding in Fortran.8681

### How to transform a projected 3D rectangle into a 2D axis aligned rectangle

I have an image of a 3D rectangle (which due to the projection distortion is not a rectangle in the image). I know the all world and image coordinates of all corners of this rectangle.5934

### Why not incrementing z?

I am trying to write a simple state machine executor in C. I have this code:6707

### data.matrix() when character involved

In order to calculate the highest contribution of a row per ID I have a beautiful script which works when the IDs are a numeric. Today however I found out that it is also possible that IDs can have5430

### GLKit quaternion code not agreeing with matrix code?

I must be misunderstanding something about GLKit's handling of quaternions and rotation matrices. In the following snippet, I would expect matrices a and b to end up with identical contents (subje...8503

### How to count the number of matches in a matrix in Octave?

I have a column matrix of integers like [1;4;3;2;3].7032

### Imnitializing a prmitive array - corrupting other arrays

I am using primitive array type in xcode. Example:7514

### Better way to handle graphics matrices (instead of the Matrix class)

I'm creating a 2D drawing framework for .NET 2.0/GDI+.7562

### How Can I Solve Matrix Equation in Matlab

Say I have the following matrix equation1639

### Is it possible to solve a non-square under/over constrained matrix using Accelerate/LAPACK?

Is it possible to solve a non-square under/over constrained matrix using Accelerate/LAPACK? Such as the following two matrices. If any variables are under constrained they should equal 0 instead of...4253

### Turn 2 coordinates vectors into matrix, matlab

I have 2 vectors, one call X and enother calls Y.4275

### c++ segmentation fault when copying a matrix

I'm having a problem with a matrix, and the problem is when I try to copy it it gives me the error 'Segmentation Fault'. This is the code involved:9592

### Do I have to implement my own matrix stack in a WP8 Direct3D application?

I would like to use a matrix stack to keep track of transforms in a hierarchical model. Only bummer is, it appears that there is no built-in matrix stack class I can use to do this. The Direct3D109

### Simple ray tracing tutorial?

Years ago at uni I wrote a ray tracer in C++, but now I can hardly remember any of it. Just for fun, I decided to try writing a ray tracer again, this time in C#. But sadly I'm struggling getting s...8868

### How Can I Display a N x N Matrix of Random Numbers in Java?

I'm trying to create a matrix of random double numbers. The matrix must be of size n x n and all numbers must be between 1 and 100. I've been trying to sort it out for ages now and I know it must be6918

### Type-safe matrix multiplication

After the longwinded discussion at Write this Scala Matrix multiplication in Haskell, I was left wondering...what would a type-safe matrix multiplication look like? So here's your challenge: either...3476

### selecting columns specified by a random vector in R

I have a large matrix from which I would like to randomly extract a smaller matrix. (I want to do this 1000 times, so ultimately it will be in a for loop.) Say for example that I have this 9x9 ma...5435

### R Retrieve column name under condition in a matrix

I have a matrix with 0 or 1 values. When a line has only one "1", I want to get in return the column name in which is the "1" value and in any other cases get "0". For the example below:9399

### MPI Seg. fault when using send/recv with Dynamic Allocation

I'm dealing with dynamic allocated matrices, and need to send/recv them from a process to another.5100

### return a row from a 2d-array with the max value in a specific column (ruby)

For that matter I created a matrix to find the requested row:6082

### generating a pseduo-random positive definite matrix

I wanted to test a simple Cholesky code I wrote in C++. So I am generating a random lower-triangular L and multiplying by its transpose to generate A.7412

### calculate determinant calculation in java

I am calculating the inverse of a matrix using the adjoint method. first i have to calculate the determinant of the matrix. to calculate the determinant I first create an upper triangular matrix an...1052

### Rotate a list-of-list matrix in Clojure

I'm new to Clojure and functional programming in general. I'm at a loss in how to handle this in a functional way.4281

### R Show P-value results of lm as matrix

I have a data frame containing multiple socio-economic factors with the correspondent obersvations. I want to run an lm-Analysis on all of them and then form a new matrix(or data frame) which conta...7546

### How to separate rows from matrix in matlab based on a value in column?

I have a matrix which is a 2d array read from a text file. Each row of text file has 3 entries. The 3rd column has values ranging from 1 to 4. And I want to separate the rows based on this value an...6279

### how to convert image to matrix

i am interested how to convert given image into matrix form with just numbers?for example let take following picture2888

### Array of CvScalars

I am trying to find the mean and standard deviation of certain images.I am using cvAvgSdv command which returns CvScalar values.I want to store the mean and deviations in an array or matrix.Can you6588

6272

### Count number of values in matrix within given range

I have matrix8621

### Creating a symmetric matrix

I want to learn how to create a symmetric matrix in VBA. For example in the first step I want to choose Range("C3:I3") then copy to the Range("B4:B10"). In the second stage it should choose1103

### How to make random matrix whose rows must all sum <=11 and which cannot contain consecutive triplets of 0-0-0 in any row

I want to make an array called result, which has dimensions (14,12,10) and has values random[0 2], but it should not contain 0 more than three consecutive times in each row (dimension 2), and the s...4183

### Array vs Matrix in terms of memory in Java

I am working on a project that involves heuristics, and I built it in Java (Should have probably made it in C).7845

### R matrix plot with colour threshold and grid

my matrix consists of values between 0 and 100 and has the dimensions of 100 x 100.4403

### CUDA C Matrix Multiplication

EDITED to correspond with current state after linked question.3378

### Principal Component Analysis (PCA) using python

I am trying to implement face recognition by Principal Component Analysis (PCA) using python. I am following the steps in this tutorial:9613

### Create a list of distance matrices in R

Using the Cshapes package in R, I want to create a list of matrices that measure for each year whether two countries are neigbors or not.7372

### C# matrix-class design (transpose method)

i'm currently working on a matrix implementation in C# . It's not a question about how sth. should work or sth. similar. It's more about the "design-part" ... So, i want to implement a function, wh...4201

### Rotating a 3D matrix in MATLAB

I have a 3D matrix with the dimensions 6, 2, and 10. I want the row dimension to switch places with the height dimension, that is, 10-2-6. reshape doesn't achieve this the way I want.8472

### Converting a frequency matrix to a list of ordered pairs in R

Let's say I have a 3x3 matrix of frequency values. Each cell in this matrix represents the number of entities detected at a certain location (the specifics about these locations don't matter for our6986