Questions tagged as 'matriz'

1
answer

Identifying the most efficient method of identifying the central element of an array

I have the following algorithm: import numpy as np matriz = np.array(np.zeros(81).reshape(9, 9)) for i in range(1, matriz.shape[0], 3): for j in range(1, matriz.shape[1], 3): matriz[i, j] = 255 print(matriz) It generates the...
asked by 23.09.2017 / 16:52
1
answer

Compare rows of matrices with different dimensions and return a single logical vector

I have two coordinate arrays, the A matrix with 83213 rows and two columns (longitude, latitude) and the B matrix with 46886 rows and two columns (longitude, latitude). I would like to compare the coordinates of these two arrays and return a log...
asked by 09.04.2017 / 22:52
1
answer

Know when a file line starts with a given string

I have a file like this: # Blender v2.69 (sub 0) OBJ File: 'CUBO.blend' # www.blender.org mtllib cube.mtl o Cube.022_Cube.030 v 0.450000 -1.450000 0.550000 v 0.450000 -1.450000 1.450000 v -0.450000 -1.450000 1.450000 v -0.449999 -1.450000 0.55...
asked by 09.11.2016 / 16:06
1
answer

Read text file picking float numbers and playing in array

I have a text file for example with: v 1.000000 -1.000000 -1.000000 v 1.000000 -1.000000 1.000000 v -1.000000 -1.000000 1.000000 v -1.000000 -1.000000 -1.000000 v 1.000000 1.000000 -0.999999 v 0.999999 1.000000 1.000001 v -1.000000 1.000000 1....
asked by 09.11.2016 / 04:23
1
answer

Calculate distance between two indexes of an array?

I want to get two indexes of the array, and subtract that value. For example, I want to enter index [0, 1] and [2, 10] . And here I want to subtract the value, to calculate the distance between these points. for (int i = 0;...
asked by 28.09.2016 / 18:52
1
answer

NullPointerException when comparing two String arrays in java

I have two String arrays and when I run this: if (prod[i][0].equals(temporaria[j][0]) && prod[i][0]!= null && temporaria[j][0]!= null) I get NullPointerException without even entering the IF loop. I found it strange that...
asked by 08.09.2016 / 23:03
2
answers

Matrix in dynamic allocation with execution failure

Hello The following code has compiled but has an error executing: #include <stdlib.h> #include <stdio.h> #include <conio.h> typedef struct { char *nome; int valor; int peso; } objeto; objeto obj[] = { {"...
asked by 18.06.2016 / 05:06
1
answer

How to return the data handling in Matrix passed as parameter to routines in VBA / Excel?

I need to pass distinct arrays to a routine that sorts its elements and receives other treatments, and then I want it to return those sorted and treated values to the original array ; for example, I passed out-of-order values and some fractio...
asked by 05.07.2016 / 19:53
1
answer

Catch only equal elements in an array

I have an array for example: 1 4 7 1 3 4 6 7 1 2 3 4 5 6 I have to see the numbers that repeat on ALL lines, in the example, should be the numbers: 1 and 4. For they are repeating on all lines. Vector<Integer> validos = new Vector&l...
asked by 17.06.2016 / 17:23
1
answer

Problem with vector function in C ++

Hello, I'm trying to make a matrix calculator and my idea would be for the user to enter with the number of rows, columns and soon after with the array elements, the problem is that when I write the elements the program gives error of input strea...
asked by 02.06.2016 / 17:21