Questions tagged as 'matriz'

1
answer

Comparison of two matrices with different sizes

I have two arrays with these dimensions and would like to remove the common lines between the two arrays and form another array without these elements. How could R do this? a = matrix(1:30, ncol = 5, byrow = T) b = matrix(6:15, ncol = 5, byro...
asked by 31.05.2015 / 21:40
1
answer

How to declare and initialize two-dimensional arrays?

I have to save the row, column and contents of a worksheet. For this I created a two-dimensional matrix. My difficulty is how do I initialize it? I believe the statement is no longer correct because I get ArrayIndexOutOfBoundsException . I...
asked by 15.04.2015 / 14:59
1
answer

Concatenate two columns of an array by forming a string of characters

Suppose I have the following vectors: n <- c(1:5) c <- c("A","B","C","D","E") I build the following array with them: m <- matrix(c(n,c), ncol = 2) What is the best way to get a vector like this: "1 - A", "2 - B", "3 - C", "4...
asked by 17.01.2017 / 20:28
1
answer

Creating an array with variables with different correlations in R?

I need to generate data series that have correlations defined using R. I used a method that I found here in the OS (#) and managed to create the variables with the desired correlation, however, when trying to automate this process for the creati...
asked by 31.03.2014 / 23:03
2
answers

PHP Matrix how to fill

I want to fill this matrix. It works, but when I try to put more than one result on a single line, only the last one appears. How to correct? <h1>Mapa</h1> <?php $linha=0; $coluna=0; //preencher o mapa //debug($planeta); $m...
asked by 10.08.2015 / 02:17
1
answer

How to apply / search for global / local transformations in OpenGL

I'm programming a simple Game Engine using the OpenGL graphics API. But I have a problem that I can not solve. The problem is that the transformations in the world (world) do not work correctly. The scale transformations are normal, but the...
asked by 20.04.2014 / 15:00
1
answer

Operation with three-dimensional arrays

Reframing the question, I would like to implement the following equation: WhereDisanarrayoforderixkxl,lambdaisamatrixkxjandpk={1,2,3,4,5,6}.ForthisIneedsomefunctionthatoperateswiththree-dimensionalarrayinsteadofnestedloops.Belowthepostaddedby...
asked by 26.05.2015 / 02:37
5
answers

Replace If / else with Case javascript

I would like to replace the if / else with Case because I believe it will be better for understanding the code since it will be a little long, but I can not access the Array that will have the conditions to activate the actions. Is the error in...
asked by 19.03.2014 / 15:07
3
answers

Catching more items in a list array in Python

I have an array in Python made up of arrays. But these arrays can have different sizes. For example: matriz = [[1,2,3],[4,5,6,7],[1,2,3,4,5,6]] What I want to know is if there is a medium (some python-ready function) that returns the size o...
asked by 07.12.2016 / 14:51
3
answers

How to divide the elements of an array by the average of your column

I need to split the elements of an array by its column mean, how can I do this, is there any function to perform this simple operation? Considering the array: > A <- matrix(1:16, ncol = 4) > A [,1] [,2] [,3] [,4] [1,]...
asked by 11.02.2016 / 18:58