Questions tagged as 'matrices'

2
answers

Doubt about matrix travel

I have a question about how to go through the even rows of a matrix, I put it this way: for(int i=2;i<=get_m();i+2) My question is: In the increment part of the row can i+2 be made to go through only the even rows?     
asked by 13.08.2017 / 14:28
3
answers

Problem with recursive multidimensional matrix

I need to make a recursive multidimensional array in javascript. I have made a function that clones an array, and I thought what the function of the matrix would be, but I do not know what I'm doing wrong. I want, for example, matrix([2,3,...
asked by 23.11.2016 / 02:43
3
answers

Print edges of a c ++ matrix

Community, I ask for your help with a small problem. I'm just learning C ++ and I've been working with arrays and arrays, I understand the logic of how to print a matrix and how it goes through its contents, but there are things that I can not s...
asked by 05.04.2017 / 20:16
2
answers

Fill an n * m matrix diagonally

I have a problem that involves matrices, what I need to do is fill a matrix of N * M of dimension (that is, of a number n of columns and rows given by the user), with even numbers. example: I have come up with the code, but I can not ma...
asked by 22.11.2018 / 20:27
1
answer

matrix staggering in python

I have problems when trying to stagger a 5x5 matrix. First I made a null line go to the last row of the matrix (it worked), then I tried to make a row with the highest index fall below the one with the lowest index, but on the line: if pivos_i...
asked by 14.10.2017 / 20:05
1
answer

How to add a matrix n x n using threads (Thread)?

I want to know how to add a square matrix n x n using java threads and I did it with a fixed matrix of 2 x 2 but I can not think of doing it with a matrix of n x n. //Clase Suma public class Suma extends Thread { private int n1; private int...
asked by 23.12.2016 / 22:50
2
answers

Add integers of an array in python

This is a simple question but I have not found any post related to this topic. matriz=[[1,2,3],[4,5,6][7,8,9]] I would like to add all the grids of this matrix to each other (1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9) so that I returned 45 in a new...
asked by 23.05.2018 / 23:43
3
answers

Multiply matrices in python

This is a question a bit simple but I can not solve it on my own, and I have not found any post related to this topic, my question is this: matriz=[[1,1,1],[1,1,1],[1,1,1]] print(matriz) matriz[0]=matriz[0]*2 print(matriz) What I want to...
asked by 21.05.2018 / 22:37
1
answer

Why do you round my decimals? Problem with two-dimensional arrangement C

I am starting in the art of programming, and I am working on an exercise to show the inverse of a matrix. The inverse matrix is defined as a double array, and I am using the algorithm for cofactors. The problem is when I show the matrix on the...
asked by 30.07.2018 / 00:24
1
answer

Make the diagonal of a matrix 0. Python

Good morning everyone, I would like to be able to make the diagonal of a matrix equal to 0 with some type of command, does anyone know how? Is there any numpy that can do it? for example SO: [,0] [,1] [,2] [,3] [,4] [0,] 0 0 1...
asked by 03.08.2017 / 10:12