Questions tagged as 'matrices'

1
answer

Put zeros at the ends of a java matrix

I am creating a method that given a matrix, put the whole frame full of zeros, that is to say for the matrix 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 the exit should be 0 0 0 0 0 6 7 0 0 10 11 0 0 0 0 0 I have this code:...
asked by 02.12.2017 / 17:32
1
answer

Word Search, Browse Matrix

Good afternoon I'm programming a soup of letters in c ++ that shows on the screen the matrix with all the letters. I must be able to go through the matrix with the arrow keys and by pressing enter on a letter that is between the accepted ones, c...
asked by 06.11.2017 / 00:45
1
answer

Subtract the previous value within a row and accumulate it in another matrix in R

My intention is for a given matrix, go through the row and each value [i,j] subtract the value [i,j-1] . Once traveled, if the value is negative, it accumulates it in [i,2] and if it is positive in [i,1] . Here's an...
asked by 25.09.2017 / 17:57
2
answers

Save data from a .txt [closed]

Good to everyone I have a question about how to save the data of a .txt that are in such a way: Data 1 1.0 2.0 1.0 3.0 2.0 3.0 Elements 1 3.0 32.0 4.1 54. 6 Data 2 2.2 1.0 23.0 9.0 32.0 2.0 Go saving them in different...
asked by 26.09.2017 / 12:28
1
answer

Compare an element of one matrix with the next one and if it is equal to eliminate the complete row in python

I have this matrix    and I need to delete the rows that have the elements of the second column repeated I need something like this:    I have this code: for i in range(a,b): if lines3[i-1,1] == lines3[i,1]:...
asked by 20.05.2017 / 00:21
2
answers

Python - Convert float to string

I have a matrix of floats of 3000 by 17, the theme is that in the first column I want to save strings. With the following code: tabla = numpy.empty((3000, 17)) nombres = ['i0{i}_0{d}_{n}.bmp'.format(i = imagen, d = distorsion, n = nivel)...
asked by 10.04.2017 / 20:52
0
answers

MacKay Neal Algorithm - Stuffing a matrix with ones and zeros

I need to fill in a matrix with ones and zeros. The parameters that are provided are its dimension (N columns and k = N * (1-r) rows) and two vectors h and v that represent the distribution of rows and columns, respectively. For example, suppose...
asked by 16.03.2017 / 12:30
1
answer

Python MemoryError, maximum limit?

I need to create a matrix NxN where N=55000 , the problem is that I do not know if I reach the memory limit supported by python. When I run this line: metric_space = np.zeros((N,N)) simply returns me: MemoryError is there...
asked by 15.05.2017 / 12:08
1
answer

Access elements of a matrix through pointer arithmetic

How can I access the elements of an integer array using pointer arithmetic? I am clear that to access those of a vector is such that *(vector+"posicion") but for a matrix I do not know how I can do it. I know that they can be writte...
asked by 15.06.2017 / 11:08
2
answers

Multiply Python arrays

I would like to understand the flow of these loops for at each round, since according to what I understood of matrix multiplication and according to the loop: in the first round    i, j and k would have a value of zero, therefore in...
asked by 23.11.2018 / 19:01