Questions tagged as 'matrices'

1
answer

Why does my program fail just before it ends?

Encode this program that consists of reading 2 matrices of whole numbers, adding the values that do not belong to the diagonal of each matrix and in the end determining if said averages are the same or different. The fact is that once he give...
asked by 16.05.2018 / 01:18
3
answers

Matrix MxN, fill vector with matrix values.

import random n = int(input("Ingrese el numero de fila: \n")) m = int(input("Ingrese el numero de columna: \n")) #a = n*m matriz = [] for i in range(n): for j in range(m): matriz[i][j] = random.randint(0, 100) print(matriz) I h...
asked by 28.04.2018 / 04:48
1
answer

ArrayIndexOutOfBounds Java error handling an array

I do not know how to solve this error:    error: Exception in thread "main"   java.lang.ArrayIndexOutOfBoundsException: 0 It takes me to the next class, in the setFilas function, that I use to insert a row into a matrix. package...
asked by 29.03.2018 / 17:00
2
answers

doubt triangular matrix superior c ++

I had doubts about the route of the upper triangular matrix, for me the upper triangular is that of the photo: for (int i=1; i<=m_-1; i++){ for (int j=i+1; j<= n_;j++){ Could you start at i = 1? Why the stop condition for the f...
asked by 26.07.2017 / 01:35
1
answer

Print Matrix

When I print this matrix, it should go vertical, as the 1s come out, but I get everything in a straight line. But if after cout << char(254); I put a endl I get spaces between each character and not together. if (x == 1) {...
asked by 08.11.2018 / 01:12
1
answer

print sum of matrices in java

Hellos ppl, I come with a curiosity, the code below works well, if I have the following arrays: int [][] vec1 = {{1,2,3},{4,5,6}}; int [][] vec2 = {{7,8,9},{10,11,12}}; It gives me as a result: [ 8 10 12 14 16 1...
asked by 01.07.2018 / 04:37
1
answer

Sum of matrices from a text file

Good day! I have to make a program where 2 matrices are added from a file, but I have no idea how to put the codes together. The image shows what I am asked for and in the second program at the time of execution, it does not matter what numbers...
asked by 23.05.2018 / 09:13
1
answer

convert .txt file to two-dimensional array with python

I have a file .txt with a lot of information, I want to read it with python but at the same time I read it I need to fill a two-dimensional array taking the word or the data separated by the comma as a position and not each character as a...
asked by 27.03.2018 / 21:29
1
answer

Compare the data of a matrix with a character

I'm starting to program in java, novice in this language, I'm doing a cinema seating assignment program, which I'm doing with a matrix of dimension 6, but when comparing the matrices with a character it performs well but I enter || (or) to compa...
asked by 09.02.2018 / 16:27
1
answer

Problem with Matrix

You will see I am doing a program in which you ask for the elements of a matrix and it returns them to me, the point is that when you execute it, you return the last value that you enter repeatedly. Example if I assign a 2x2 matrix it asks me fo...
asked by 10.12.2017 / 18:15