Questions tagged as 'matriz'

1
answer

Construct an array through a vector

I put nine digits in the vector but my array comes out with random numbers, I would like my array to come out with the numbers that are in the vector below below my code: #include <stdio.h> #include <locale.h> int vetor [9]; int m...
asked by 07.06.2016 / 23:39
2
answers

Inserting index and value into a two-dimensional array

I have a two-dimensional array (it contains data coming from the database). To traverse this data, I use a foreach (). I need to add an index and a value to this index at the end of each iteration of foreach (). Imagining as if it were an arr...
asked by 19.10.2017 / 18:40
1
answer

Pass array as function parameter?

I am studying the Dijkstra algorithm and have not yet tried to use adjacency list. I knew I could solve the problem with an array, but the fact is that I can not get the array in the function. If I put the code direct in main it works as...
asked by 25.04.2015 / 03:37
3
answers

Loop in R with indexing and array

We are trying to use the for command to run a function y (say y=5+3x+4z ) by varying the values of z (say that z is a combination of 5 z=c(1,2,3,4,5) ) and that x is a normal size distribution 1000. After printing the values w...
asked by 29.03.2014 / 22:06
2
answers

Error trying to print the return of a two-dimensional array

I'm trying to print a two-dimensional array through in a loop for only the array it's returned through a function that I've created. I'm suspecting that the error should be in it but I can not find the error #include <stdio.h> #de...
asked by 09.09.2017 / 23:21
1
answer

Vector and matrix ordering [closed]

Is there another method for ordering array / array in ascending or descending order without being what I used? (What would you change in this code to make it "better"?) #include <stdio.h> #include <stdlib.h> void ordem (int vetor[...
asked by 25.10.2016 / 16:15
3
answers

How to join values in common php array?

I have the array $vetor[0]['codigo'] = '1'; $vetor[0]['valor'] = '4'; $vetor[1]['codigo'] = '1'; $vetor[1]['valor'] = '2'; $vetor[2]['codigo'] = '2'; $vetor[2]['valor'] = '2'; I need to merge all values with equal codes. Doing the ab...
asked by 16.05.2018 / 18:04
1
answer

How to break a list and transform into array in Python?

In case, I want to transform a list of a column into a 3x3 array in numerical order: lista =([[1], [2], [3], [4], [5], [6], [7], [8], [9]]) Being the expected result: ([[7 8 9] [4 5 6] [1 2 3]])...
asked by 16.04.2018 / 03:49
1
answer

Plain text editor in C

I have the following proposed exercise:    Make a program that mimics a text editor. Initially you will read the data entered by the user (lines of text) and create a vector in memory where the texts provided by the user will be stored (text...
asked by 12.06.2018 / 04:41
1
answer

Applying Loop to Elements of a Matrix (R)

Be the matrix below created from the command simu_matrix <- matrix(runif(25,0,1),nrow=5,ncol=5) V1 V2 V3 V4 V5 1 0.07357303 0.45524021 0.9352829 0.60466424 0.4725541 2 0.51018615 0.46044203...
asked by 01.07.2014 / 16:01