I realize this problem and solutions are all over StackOverflow like here however I'm still unable to make this work. Most of the examples say that I just need to multiply the row by the width and add the column meaning the location (4, 3) in a 4x4 s
I have a dataset with 519 islands. I have calculated the distance between each island using rdist.earth and got a nice 519:519 Matrix. I have a subset of the islands (78) that have particular threats on them that could get to the other islands. I nee
I'm trying to convert a straight-forward C code to matlab but I got stuck in something that seemed to be quite clear at first. What's this segment doing? SIZE_N2 = 25, w = 533, h = 800 //Init the L matrix. L is a sparse matrix that only contains SIZE
These are my two matrices in four arrays: Array ( [0] => Array ( [0] => 1 [1] => 2 ) [1] => Array ( [0] => 4 [1] => 5 ) ) Array ( [0] => Array ( [0] => 1 [1] => 2 ) [1] => Array ( [0] => 4 [1] => 5 ) ) How can I add up
I've been working on this code for get the lower triangular matrix for solving linear equations, here's the code: int jordan (){ float fracc=0; int z=0; fila=0; colum=0; for(colum=0;colum<cant;colum++) { buscar_ceros(); /*here we call*/ for(fila=colu
Hi everybody I have this problem: I have Dataset of n vectors each has D dimensions. I also have a covariance matrix of size D*D, Let It be C. I perform the following action: I choose K vectors from the dataset, and also choose E dimensions randomly.
I am trying to take the inverse of a 365x365 matrix. Some of the values get as large as 365**365 and so they are converted to long numbers. I don't know if the linalg.matrix_power() function can handle long numbers. I know the problem comes from this
I have a 3D matrix say for eg. A(10x5x8). I need to get a 2D matrix (Boolean) out of it of size 10x5. True if its elemental 3 Dimensional values are all same. i.e. Result(1,1) = 1 if A(1,1,1) == A(1,1,2) == A(1,1,3) etc.. False if at least one is dif
I need to be able to encrypt and decrypt a message using a Polybius Square, I know how this works on paper but dont know where to start when turing it into a program. I was planning to use a hashmap but I was told thats a bad way to go about it and t
I'm trying to define a matrix in C with 100,000 columns and 100,000 lines of boolean type (bool matrix[100000][100000]), how I do that? --------------Solutions------------- On a technical note, a definition is quite different to a declaration. I figu
I want to write this matrix in matlab, s=[0 ..... 0 B 0 .... 0 AB B .... 0 . . . . . . . . . 0 .... A^(n-1)*B ... AB B ] I have tried this below code but giving error, N = 50; A=[2 3;4 1]; B=[3 ;2]; [nx,ny] = size(A); s(nx,ny,N) = 0; for n=1:1:N s(:,
I would like to create a matrix using a list whose elements would be the elements of the matrix under the diagonal. import numpy as np x1 = np.array([0.9375, 0.75, 0.4375, 0.0, 0.9375, 0.75, 0.4375, 0.9375, 0.75, 0.9375]) x1 the matrix I would like t
I have a data.frame that is 100x100 and I need to sum them up as an escalator. Starting with the first entry of the first column and then keep adding the first entry of the second column to the second entry of the first and so on until the the last e
I have a 3D (x,y,nframes) matrix/ movie ( named ch), and a logical mask (x,y). I want to do the mean of the mask pixels in each frame , at the end I get a vector of dim 1xnframes. And I want to do it with the reshape instead than frame by frame, but
I´m trying to read a text file and store the data in a matrix. I print the results after read each line and seems it is working, but if I print the matrix at the end, I don't have the same results. I can't find what i'm doing wrong! int main() { int
I am having trouble sorting a 3D matrix by whichever row I want, but still having the other two columns match up with the one sorted row. ex)before sort: 5 4 1 4 6 3 9 6 5 after sort: 1 4 5 3 6 4 5 6 9 So only the first row got sorted in ascending or
I have a linear system of equations like MX=N. M is a 21x21 matrix with many elements zero. When I try to solve this system with X = np.linalg.solve(M, N), it gives me this error: numpy.linalg.linalg.LinAlgError: Singular matrix The problem here is t
On line 38 - pool.submit(new Multi(N,i,j,a,b,c)); i have a variable j which is not initialising. Im not sure whats wrong as all others have initialised, this has been bugging me for the past hour. Please could someone help me fix this error. public c
I am trying to print a multidimensional array (matrix) in Perl passing reference to array to subroutine. Here is my code: sub print_matrix(\@) { my $array = shift; for my $i ( 0 .. $#{ $array } ) { my $row = $array[$i]; for my $j ( 0 .. $#($row) ) {
I have two meshes: mesh A and mesh B. I'm working with MeshLab and all I need is to align them and then extrapolate a transformation matrix that brings B on A. When I use the alignment tool, I glue A and I set it as the base mesh. Then I perform the