matrix Questions

3

I am learning about 3d graphics and have stumbled upon matrixes, which I don't fully understand. I have a 3d object, with topology, points in coordinate system and ECS (4x4 matrix of the object). E...
Hedwig asked 16/3, 2015 at 14:44

5

Solved

I have a single vector of flow data (29 data) and a 3D matrix data(360*180*29) i want to find the correlation between single vector and 3D vector. The correlation matrix will have a size of 360*18...
Barthol asked 3/2, 2012 at 6:59

7

Solved

So the obvious way to transpose a matrix is to use : for( int i = 0; i < n; i++ ) for( int j = 0; j < n; j++ ) destination[j+i*n] = source[i+j*n]; but I want something that will take ...
Birl asked 4/3, 2011 at 23:17

12

Solved

I have a matrix (relatively big) that I need to transpose. For example assume that my matrix is a b c d e f g h i j k l m n o p q r I want the result be as follows: a g m b h n c I o d j p e k...
Prayer asked 24/5, 2013 at 14:24

1

Solved

Consider the following code in Python, where multiplying a pre-transposed matrix yields faster execution time compared to multiplying a non-transposed matrix: import numpy as np import time # Gene...
Otha asked 9/7, 2023 at 19:55

5

Solved

In this question it is explained how to access the lower and upper triagular parts of a given matrix, say: m = np.matrix([[11, 12, 13], [21, 22, 23], [31, 32, 33]]) Here I need to transform th...
Octameter asked 8/7, 2013 at 13:18

7

Solved

When should one use a data.frame, and when is it better to use a matrix? Both keep data in a rectangular format, so sometimes it's unclear. Are there any general rules of thumb for when to use wh...
Ragi asked 1/3, 2011 at 18:36

6

Solved

I have a tsv that looks like this (long-form): one two value a b 30 a c 40 a d 20 b c 10 b d 05 c d 30 I'm trying to get this into a dataframe for R (or pandas) a b c d a 00 30 40 20 b...
Diameter asked 28/6, 2015 at 1:58

3

Solved

I'd like to know if there is a more efficient/pythonic way to add multiple numpy arrays (2D) rather than: def sum_multiple_arrays(list_of_arrays): a = np.zeros(shape=list_of_arrays[0].shape) #init...
Exciter asked 9/2, 2021 at 1:18

2

Solved

I am starting to test Haskell for linear algebra. Does anyone have any recommendations for the best package for this purpose? Any other good resources for doing basic matrix manipulation with Haske...
Experientialism asked 26/2, 2010 at 16:58

4

Solved

I am running 64 bit R 3.1 in a 64bit Ubuntu environment with 400GB of RAM, and I am encountering a strange limitation when dealing with large matrices. I have a numeric matrix called A, that is 4...
Putandtake asked 20/6, 2014 at 21:10

6

I have a symbolic array that can be expressed as: from sympy import lambdify, Matrix g_sympy = Matrix([[ x, 2*x, 3*x, 4*x, 5*x, 6*x, 7*x, 8*x, 9*x, 10*x], [x**2, x**3, x**4, x**5, x**6, x**7, x*...
Hispaniola asked 12/6, 2013 at 16:10

17

Solved

I have a list of lists, something like [[1, 2, 3,],[4, 5, 6,],[7, 8, 9]]. Represented graphically as: 1 2 3 4 5 6 7 8 9 I'm looking for an elegant approach to check the value of neighbours o...
Drucilla asked 25/10, 2009 at 13:36

3

I have two large sets of vectors, A and B. Each element of A is a 1-dimensional vector of length 400, with float values between -10 and 10. For each vector in A, I'm trying to calculate the cosine ...
Foresheet asked 3/12, 2015 at 15:48

7

I have the following matrix in Excel: 3 Columns: A, B, C Row 1: a b c Row 2: d e f Row 3: ghi What I need is a single column with all these values. The result should look like that: a b c ...
Wore asked 2/2, 2015 at 16:42

4

Supose we have a matrix like this one: # Set seed set.seed(12345) # Generate data.frame df <- matrix(sample(1:100,100), nrow = 10) I would like to get the row and column where the first n hi...
Li asked 30/5, 2023 at 6:40

3

Solved

I have a vector say a = c(1,2,3,4,5,6) I would like to organize them into the elements into an upper triangle matrix (without considering diagonal elements, they are all zero) by row. My goal i...
Volumed asked 11/6, 2015 at 17:15

3

Solved

A question was already asked on how keeping colnames in a matrix when applying apply, sapply, etc. here. But I didn't find how to keep the column AND row names of a matrix. Below an example: mat ...
Humpback asked 25/9, 2019 at 12:29

7

Solved

I have a matrix with 5 columns and 4 rows. I also have a vector with 3 columns. I want to subtract the values in the vector from columns 3,4 and 5 respectively at each row of the matrix. b <- m...
Gallery asked 1/7, 2014 at 23:31

10

Solved

Is there a built in way of printing a readable matrix in Ruby? For example require 'matrix' m1 = Matrix[[1,2], [3,4]] print m1 and have it show => 1 2 3 4 in the REPL instead of: => ...
Henning asked 29/4, 2012 at 5:49

3

Solved

I'm trying to deduct the 2D-transformation parameters from the result. Given is a large number of samples in an unknown X-Y-coordinate system as well as their respective counterparts in WGS84 (lon...
Nu asked 18/6, 2013 at 14:24

16

Solved

Say you want to convert a matrix to a list, where each element of the list contains one column. list() or as.list() obviously won't work, and until now I use a hack using the behaviour of tapply : ...
Pennyweight asked 25/7, 2011 at 17:8

14

Solved

I'm doing a function that multiplies 2 matrices. The matrices will always have the same number of rows and columns. (2x2, 5x5, 23x23, ...) When I print it, it doesn't work. Why? For example, if I c...
Gamete asked 29/11, 2014 at 17:36

7

Solved

I want to create a circulant matrix from a vector in R. A circulant matrix is a matrix with the following form. 1 2 3 4 4 1 2 3 3 4 1 2 2 3 4 1 The second row is the same as the first row except...
Selsyn asked 3/4, 2013 at 18:37

1

I am trying to distribute my matrix in block cyclic fashion. I learned a lot from this question (MPI IO Reading and Writing Block Cyclic Matrix), but that is not what I really need. Let me explain ...
Presentative asked 24/1, 2015 at 18:9

© 2022 - 2024 — McMap. All rights reserved.