Questions tagged as 'matriz'

1
answer

How to return the index of an array and its value in different variables?

I have an array of the following structure Matriz[indice][valor] How do I return the index in one variable, and the value in another? Exdrúxulo example: $indice = $matriz[indice] And for the value: $valor = $matriz[indice][valor]...
asked by 14.05.2015 / 02:56
1
answer

In a matrix Z of elements (i, j) how to assign the value 1 when i = j? (software R)

By the following condition: ifelse(??, 1, Z/(1+1)) What to put in place of "??" so that R understands that when i = j in the matrix Z, I want to assign the value 1?     
asked by 17.06.2017 / 03:38
2
answers

Majority matrix vote in R

I want to compare elements of an array, for example, in line 1 (fixed) I want to know which object happens most frequently and return the same, I need it automated, because the number of columns is variable. Here is an example of the code: M...
asked by 04.09.2015 / 15:08
1
answer

Error Pointer to pointer in c ++!

I created a Matrix class, to manipulate an array. In the class declaration I have the following members (public): class Matrix{ public: unsigned char **mat; //ponteiro para ponteiro de uchar int nRows; //numero de linhas int nCols;...
asked by 26.03.2015 / 13:14
1
answer

Replace values of specific columns in an array (R)

In the array ( ret_matrix ) IBOV PETR4 VALE5 ITUB4 BBDC4 PETR3 [1,] -0.040630825 -0.027795652 -0.052643733 -0.053488685 -0.048455772 -0.061668282 [2,] -0.030463489 -0.031010237 0 -0.04022...
asked by 10.06.2014 / 22:07
1
answer

How to add the diagonal of an array in C?

Help me in the following exercise: Make a program that defines an array of 5x5 size integers. Then, initialize this array with random numbers between 5 and 9. Finally, your program must calculate the sum of the diagonal elements of that matri...
asked by 05.05.2016 / 01:05
1
answer

How to transform the row of a query into columns and group according to the first 4 characters?

I would like to transform the return of my SQL query into an array where I select the first four characters, which will work as a sort of group, and return the values referring to that group in columns. I'm analyzing the PHP language. HowI'd...
asked by 31.10.2017 / 18:10
1
answer

Mounting table array in Django

I have two tables, in the example (any) of the figure below I have the Paises table and the Energia table SettingupathirdtableinDjangoIwouldhavesomethingwiththefieldspais,energia,valorÁustria,Carvão,3.6Áustria,Ciclocombinadodeg...
asked by 05.11.2015 / 16:07
1
answer

Matrix in Forms

I'm having trouble creating an array within a JPanel in NetBeans, I've tried customizing the code by putting the code inside the NetBeans customization: jPanel1.setLayout(new GridLayout(15,15)); JLabel[][] grid =...
asked by 11.11.2014 / 17:47
2
answers

How to move, rotate or scale an object on its local axis in OpenGL?

Hello, I have a HTransform class that stores an array, position, orientation, and scale for each object, this class is the base class of each object or entity. I made a function to move the objects and another to update the array when the...
asked by 02.04.2014 / 01:22