Questions tagged as 'matriz'

1
answer

Random choice of rows in an array in R

I have a problem that gives me a numeric matrix mxn where m is the number of observations (row) and n the number of variables (column). I need to randomly choose p rows (p < m) without replacement from that array. So I will create a p x n mat...
asked by 17.04.2018 / 03:04
1
answer

How to use QVectorQVector double as array?

In mainwindow.h I have: private: QVector<QVector<double> > numbers; //Variável que será minha matriz public slot: void realizar_calcs(QVector<QVector<double> > &numbers); Na mainwindow.cpp void Ma...
asked by 09.11.2014 / 22:14
2
answers

Compare 2 Matrices and Return a Third (R)

The following arrays Matrix [,1] [,2] [,3] [,4] [,5] [1,] 0.228 0.285 0.285 0.285 0.380 [2,] 0.228 0.285 0.570 0.380 0.228 [3,] 0.380 0.285 0.228 0.380 0.285 [4,] 0.285 0.285 0.570 0.380 0.380 [5,] 0.380 0.228 0.285 0.285 0.380...
asked by 01.07.2014 / 16:38
1
answer

Problems with dynamic array allocation

I'm trying to dynamically allocate an array, however I'm having some problems in runtime and I'm also getting a warning from GCC in < in> compile time . Follow the code below for a better analysis of the problem: #include <time.h&g...
asked by 27.12.2018 / 16:10
2
answers

Pass array as pointer

I need to make the proposal:    Construct a function that takes parameters from a pointer to an array, the number of rows and columns, and prints the array elements. But I'm learning pointers and having difficulties, I've tried in several...
asked by 15.11.2016 / 02:34
2
answers

Java constructor with array

I'm learning about constructors in java but I stuck in the exercise of college that seemed simple, the proposal is to create a class constructor with an array, and call it in another class to attribulate the values to array: Builder: public...
asked by 22.03.2016 / 02:14
1
answer

Adjacent values

I need to create an algorithm that calculates the minimum distance value between the indexes of an array containing adjacent values . But what are adjacent values could anyone give me examples? For example, in matrix A such that: A...
asked by 11.02.2016 / 20:57
1
answer

Create matrix of frequency distribution in R (numerical variable VS numerical)

I have two columns: supply situation (categorical variable) and number of students (numeric variable). I want to create a table that tells how many students are in each mode (class / levels). The goal is this (example): Thank you, PS: By...
asked by 24.04.2015 / 19:56
3
answers

Replace Zero and Infinity values in an array (R)

In the example matrix below (daily stock returns): IBOV PETR4 VALE5 ITUB4 BBDC4 PETR3 [1,] -0.03981646 -0.027412907 -0.051282051 -0.05208333 -0.047300526 -0.059805285 [2,] -0.03000415 -0.030534351 -0.04...
asked by 02.06.2014 / 15:54
1
answer

Read array elements and print them

I created an algorithm that received a single variable with 9 different records that would display these values typed in matrix form (table). But by displaying the result, you are only returning the last three values in three rows in a row....
asked by 11.12.2018 / 22:47