R find minimum deviation from vector from a matrix of possible vectors

stackoverflow.com - 2013-04-21 13:00:41 - Similar - Report/Block

I have the following data set.seed(11) Data<-rbind(c(1:5),c(2:6)) Candidates <- matrix(1:25 + rnorm(25), ncol=5, dimnames=list(NULL, paste0("x", 1:5))) colnames(Data)<-colnames(Candidates) I want to subtract each row of my Data from each row of the Candidate matrix And return the minimal absolute difference So for row one I want to find...

1-dimensional Matrix is changed to a vector in R

stackoverflow.com - 2012-03-30 21:19:55 - Similar - Report/Block

> a<-matrix(c(1:9),3,3) > a [,1] [,2] [,3] [1,] 1 4 7 [2,] 2 5 8 [3,] 3 6 9 > a[3,]*a[,3] [1] 21 48 81 > class(a) [1] "matrix" > class(a[3,]) [1] "integer" In R, 1-dimensional matrix is changed to a vector. Can I avoid this? I would like to keep 1-D matrix as a matrix. Actually, I need to...

Multiply vector by matrix in R should return vector

stackoverflow.com - 2013-04-22 16:12:13 - Similar - Report/Block

In R, I want to multiply a 1x3 vector by a 3x3 matrix to produce a 1x3 vector. However R returns a matrix: > v = c(1,1,0) > m = matrix(c(1,2,1,3,1,1,2,2,1),nrow=3,ncol= 3,byrow=T) > v*m [,1] [,2] [,3] [1,] 1 2 1 [2,] 3 1 1 [3,] 0 0 0 The correct output should be a vector, not a matrix...

R: How can I disable truncation of listing of package functions?

stackoverflow.com - 2012-05-06 02:21:44 - Similar - Report/Block

How can I list all of the results that used to occur when typing packageName<tab> , i.e. the full list offered via auto-completion? In R 2.15.0, I get the following for Matrix::<tab> > library(Matrix) > Matrix:: Matrix::.__C__abIndex Matrix::.__C__atomicVector Matrix::.__C__BunchKaufman Matrix::.__C__CHMfactor Matrix::._...

Rewriting MATLAB functions in Java

java-forums.org - 2012-08-05 09:35:25 - Similar - Report/Block

Hi All I'm trying to rewrite a snippet of code I've written using Matlab into java and hoping to enlist the help of some experts. The matlab code is; Code: A=[1,2,35,5,63,1.......] %some random vector dimension 1x100 B=reshape(A,10,10); %takes vector A and reshapes it (column-wise) into a 10x10 matrix C=B*B; %Multiplys the 10x10 m...

Sixth form FP3, Further matrix algebra question.

thestudentroom.co.uk - 2013-06-11 23:38:55 - Similar - Report/Block

When reducing a symmetric matrix A to its diagonal matrix D, what method do you use? I've read and understood the following procedure; i) Find normalised eigenvectors of A. ii) Form a matrix P with columns consisting of the vectors found in (i). iii) Find the transpose of matrix P iv) D = P But is it really necessary? We know the diagonal...

Does it really inverse a transform matrix?

stackoverflow.com - 2012-06-06 11:20:43 - Similar - Report/Block

void inverse44( double *inverse, double *matrix double trans[3], trans_xf[3]; MTX3_t matrix3; inverse[0] = matrix[0]; inverse[1] = matrix[4]; inverse[2] = matrix[8]; inverse[4] = matrix[1]; inverse[5] = matrix[5]; inverse[6] = matrix[9]; inverse[8] = matrix[2]; inverse[9] = matrix[6]; inverse[10] = matrix[10]; inverse[15] = 1.0; inverse[1...

R: Rearrange matrix into three columns

stackoverflow.com - 2012-03-28 20:23:47 - Similar - Report/Block

I have a matrix in R. Each entry is a score and the rownames and colnames are ids. Instead of the matrix I just want a 3 column matrix that has: score Right now I'm using nested for loops. Like: for(i in rownames(g)) { print(which(rownames(g)==i)) for(j in colnames(g)) { cur.vector<-c(cur.ref, i...

Undergraduate Standard deviation

thestudentroom.co.uk - 2013-04-20 18:04:34 - Similar - Report/Block

I know this is really simple but I'm extremely confused on finding the standard deviation on different sets of data. I looked on a past paper (there are no solutions) and this was a question: The module marks of 99 students are shown in the table below: x-<30-<40-<60-<70-<100 f 9-4-35-21-30 Find the mean & standard deviation The mean isn'...

How to substitute `find` commands with `logical indexing` (MATLAB), for looking up vector value positions of unique values?

stackoverflow.com - 2012-02-27 12:40:15 - Similar - Report/Block

In MATLAB, I have a for loop which has a lot of interations to go through and fill a sparse matrix. The program is very slow and I would like to optimize it to see it finish some time soon. In two lines I use the command , and the editor of MATLAB, warns me that the use of logical indexing instead of will improve performace. My code...

Undergraduate Hessian matrix singular

thestudentroom.co.uk - 2013-05-10 17:43:30 - Similar - Report/Block

Question Let g(x, y) = (x^3)(y^2)(1 − x − y). Show that (0, 1) is a critical point of g(x, y) for which the Hessian matrix of g is singular. Find an approximation for g(x, y) to lowest non-trivial order in the neighborhood of the point (0, 1). Does g have a maximum or a minimum at (0, 1)? Justify your answer. So I have shown (0, 1) is a c...

The Matrix x Office Space

theawesomer.com - 2012-07-24 17:45:33 - Similar - Report/Block

Neo has to hide out from Agent Bill Lumbergh as he comes around looking for the latest T.P.S. report in this amusing combination of two incredibly classic movies, both released in 1999. Hat Tip More Awesome Stuff for You to Click On: Scott Pilgrim x The Matrix Funny: The Matrix Pill Matrix No. 5 The Matrix Dance Everything is a Remix: The...

evolveStar Join

Translate code from Java to C#

stackoverflow.com - 2012-06-03 16:19:48 - Similar - Report/Block

I'm useing a method in Java, but I want it in C# too. It is used for tell if a matrix of int is transitive or not. static boolean isTransitive(boolean[][] matrix) { for (int i = 0; i < matrix.length; i++) { for (int j = 0; j < matrix.length; j++) { if (matrix[i][j]) { for (int k = 0; k < matrix.length; k++) { if (matrix[j][k...

Undergraduate Adjoint matrix

thestudentroom.co.uk - 2013-04-21 22:58:49 - Similar - Report/Block

If we're given a matrix and told to find the adjoint of the matrix (A, for example), can we simplify the matrix before finding co factors, etc?...

parallel K nearest neighbor using openmp and segmentation fault

stackoverflow.com - 2012-03-03 14:51:19 - Similar - Report/Block

I'm trying to do k nearest neighbor KNN of the data points in "dat", so my first step is to construct a distance matrix between each point and all the other points, then for each point find the K nearest neighbor. The following code works perfect in serial without openmp. However, when I use openmp it gives a segmentation fault. I think t...

Store and retrieve large sparse matrix

stackoverflow.com - 2013-04-16 14:33:20 - Similar - Report/Block

I have a fairly large sparse matrix that, I reckon, would occupy 1Gb when loaded into memory. I don't need access to the whole matrix at all times, so some kind of memory mapping would work; it doesn't seem to be possible, however, to memory map a sparse matrix using numpy or spicy (the tools I'm familiar with). It can easily fit into mem...

Trying to find minimum and maximum from user input using Python, the sentinal value keeps appearing as -99 in the minimum

stackoverflow.com - 2013-02-25 08:34:17 - Similar - Report/Block

I was wondering how to fix my program which asks for user input on any number. To terminate the program, you input -99. Everything goes well as far as input goes, until I hit -99 to stop the program where it becomes the minimum. This is my code. The final answer for the minimum value cannot be -99. s = -99 n = 1 minimum = None maximum = N...

Undergraduate Upper and Lower triangular matrices.

thestudentroom.co.uk - 2013-05-20 16:59:42 - Similar - Report/Block

Apply gaussian elimination without pivoting to find an upper triangular matrix U. Find a lower triangular matrix L such that A=LU. I have found U as but I never know where to go next in these kinds of questions. I've computed the Transpose for U, but that didn't work, and I've vaguely done the inverse but that seems to be another upper t...

topological sorting using dfs

stackoverflow.com - 2012-04-28 12:55:18 - Similar - Report/Block

here is topological sorting using DFS in c++,which has bugs(out of bound error) #include<iostream> #include<stdio.h> using namespace std; int count=0; static int *a=new int[8]; void dfs(int u,bool v[],bool matrix[][8]) v[u]=true; for(int i=0;i<8;i++) if(!v[i]&& matrix[u][i]) dfs(i,v,matrix); a[count++]=u; } i...

Subsetting matrices

stackoverflow.com - 2012-04-13 01:40:01 - Similar - Report/Block

Considering following vector res and matrix team. the vector res represent indices, and I require to extract only those names whose index number is in vector res and gender="F". I need to do this in R and as I am a newbie to R, could not resolve this. [1] 2 12 16 5 6 19 17 14 9 4 names genders [1,] "aa" "M" [2,] "ab" "M" [3,] "al" "M"...

Appending a vector to an empty MATLAB matrix

stackoverflow.com - 2009-04-23 14:03:22 - Similar - Report/Block

I've got MATLAB code inserting n-dimensional points (n > 1) into a matrix ( myPointMatrix ) and am having thoughts about how to insert the first point. Right now the program checks the size of myPointMatrix before inserting a point. If it is 1x1, myPointMatrix is set equal to the current point. Otherwise the current point is appended. T...

Undergraduate Matrix problem: Fibonacci sequence

thestudentroom.co.uk - 2013-06-06 00:14:25 - Similar - Report/Block

http://www.artofproblemsolving.com/F...o g.php?b=10579 I understand the proof of the corollary, however, why is it a corollary? That is, why does the corollary it follow from the lemma motivationally? The general question is: given a matrix, an arbitrary vector (x,y) it multiplies, and the result of that multiplication, is it possible to...

Android OpenCV Image Rectification

stackoverflow.com - 2012-04-15 13:42:51 - Similar - Report/Block

i'm tryin to do image rectification without calibration , just using fundamental Matrix and using OpenCV Here things that i've done till now : Find Matches between two images using SURF and FLANN Descriptor Matcher List good_match = getGoodMatch(img1,img2); --> it's done , and the result is good Get Matching Point for img1 and img2 Get F...

How would I generate a model view matrix using GLKit's GLKMatrixStack library?

stackoverflow.com - 2012-03-10 21:35:57 - Similar - Report/Block

There is a header file in GLKit with the following comment: GLKMatrixStack is a CFType that allows for the creation of a 4x4 matrix stack similar to OpenGL's matrix stack. Any number of matrix stacks can be created and operated on with functions similar to those found in fixed function versions of OpenGL. How would you go about generating...

Undergraduate /6thform: Column Matrices multiplication for DOT PRODUCT

thestudentroom.co.uk - 2013-06-09 11:07:28 - Similar - Report/Block

I understand that for matrices multiplication, you have to have something along these lines for it to work: (m * n) multiplied with (n * p) = (m * p) Where matrix one has m rows and n columns, matrix two has n rows and p columns, thus the resulting matrix has m rows and p columns. However, I've just read that you can multiply two 3 by 1 c...

Dynamically allocated 2D matrix transposition (memory effective)

stackoverflow.com - 2012-03-30 15:49:22 - Similar - Report/Block

I want to transpose a matrix in C, with as little memory use as possible. Therefore it is not an option to simply create a copy of the matrix, fill it in, and delete the other one afterwards. I thus want to do every swap on the matrix itself, with 1 temp variable to reuse. Matrix elements are indexed with pointer arithmetic, but as far as...

Sixth form standard deviation question

thestudentroom.co.uk - 2013-03-25 11:03:16 - Similar - Report/Block

When calculating the mean for results you have to round the mean either up or down depending upon the number of significant figures that you recorded your results in, right? So, for example, if you had results of 8, 8 and 9 and your mean was 8.3, you would round it down to 8 right? But then when you do standard deviation on the calculator...

Efficient way of taking Logarithm function in a sparse matrix

stackoverflow.com - 2012-03-22 22:12:56 - Similar - Report/Block

I have a big sparse matrix. I want to take for all element in that sparse matrix. I try to use numpy.log() but it doesn't work with matrices. I can also take logarithm row by row. Then I crush old row with a new one. # Assume A is a sparse matrix (Linked List Format) with float values as data # It is only for one row import numpy as np...

how to convert sparse matrix to dense MAtriX d Eigen

stackoverflow.com - 2013-03-18 18:53:25 - Similar - Report/Block

Exist some easy fast way how to convert my sparse Matrix to MAtrix of doubles? Becous my Sparse matrix is not still sparse but dense, becouse of matrix products..... Other qeustion The Eigen library has the excellent performance, but I dont understand why, becouse there is onlyy .h files!!! no compile...

Undergraduate constructing a matrix with null space and column space given

thestudentroom.co.uk - 2013-04-22 15:58:02 - Similar - Report/Block

I get that M has to be a 3*4 matrix with 2 linearly independent vectors= column space of M, and 2 linearly dependent vectors. To form the matrix M, I have to find the linear dependency using the Null Space of M so I end up with these 2 equations: where c1=column 1 of matrix M 3c1 - c3 + 2c4 = 0 c1 - 2c2 + c4= 0 I then get c3 and c4 (the...

Recomposed matrix from Decomposed matrix doesn't match

stackoverflow.com - 2012-03-10 20:27:28 - Similar - Report/Block

I decomposed a matrix on XNA and got the decomposed values, then just tried to create again the Matrix from those values and the resultant Matrix does not match the original one I tried to Normalize the quaternion I tried to generate a Rotation Matrix from the Quaternion I tried swaping the order of the Transformation SRT , STR, TRS,...

HW accel Matrices on android (NDK)

gamedev.net - 2013-06-09 07:34:25 - Similar - Report/Block

on windows/directx i have XMMATRIX. on ios i have GLKit and GLKMATRIX. i can't seem to find a hardware accelerated matrix library (for example on armv7 uses NEON extension for matrix multiply) for android that i can use on the C++/NDK side. anyone have any recommendations? thanks a bunch.

Canny operator matrix in Matlab: how to implement/get? (just filter,no edge detector)

stackoverflow.com - 2012-03-16 20:07:16 - Similar - Report/Block

I'm making a project of Matlab (2011) which gives the user the possibility to filter an gray-scale image (with convolution but without looking for edges) . I know for edges there is the [edge] function and I know that for some operators (like sobel) you can use [fspecial] to get the matrix. I found a matrix (or more than one) correspondin...

Toucher 1.7.1

apktops.com - 2013-06-06 07:45:14 - Similar - Report/Block

Current Version: 1.7.1 Requires Android: 2.1 and up Category: Tools v1.7.1 update: v1.7.1 (Add) 2 new Point theme package ’Space’ and ’PinkyLove’, including 6 different point types. v1.7 (Add) New theme — ’Matrix’ –new floating theme, find it in Toucher Theme Settings (Add) Point theme –change the theme for Toucher Point, right now 2 m...

Perform nonnegative matrix factorization in R

stackoverflow.com - 2012-04-21 03:11:59 - Similar - Report/Block

I have a sparse matrix in R I now wish to perform nonnegative matrix factorization on R data.txt is a text file i created using python, it consists of 3 columns where first column specifies the row number, second the column number and third the value data.txt 1 5 10 3 2 5 4 6 9 original data.txt contains 164009 rows which is data for 2500...

Is there a way to display a matrix of chars as an image?

stackoverflow.com - 2013-04-25 03:35:42 - Similar - Report/Block

I should open with the fact that I am very new to c++. I am attempting to display a constantly updating 20x20 matrix of chars. Currently, I am displaying the the matrix using for loops as cout's (code below) but that is incredibly flickery- I'm looking for something smoother. Is there a way to convert this char matrix into an image and di...

Не все ветви кода возвращают значение. Как исправить - С++ для начинающих

cyberforum.ru - 2013-05-14 16:47:32 - Similar - Report/Block

Код: public double[,] Method(double[,] matrix, int n) //1 int k = 0; for (int i = 0; i < n; i++) for (int j = 0; j < n + 1; j++) if (matrix[i, 0] != 0) k = i; break; //2 for (int i = 0; i < n; i++) double h = matrix[0, n]; matrix[0, n] = matrix[k, n]; matrix[k, n] = h; //3 double value = matrix[0, 0]; for (int i = 0; i < n;...

Проблемы с объявлением функции-члена класса - Visual C++

cyberforum.ru - 2013-03-20 15:16:24 - Similar - Report/Block

Доброго времени суток. Пишу программу, реализующую простые матричные операции (сложение, вычитание и прочее). Код: matrix.h Код: class matrix private: double **entries; int dim; public: matrix(int); ~matrix(); void set_e(int, int, double); int get_dim(); double get_e(int, int); matrix add(matrix A, matrix B); matrix.cpp Код: #inclu...

Умножение + создание матриц - С++ для начинающих

cyberforum.ru - 2013-04-30 13:20:57 - Similar - Report/Block

Не могу разобраться с умножением матриц Выдает либо числовой мусор, либо просто нули... Вот код: Код: #include #include #include #include //- enum {max_size=10}; struct Matrix { double coef[max_size][max_size]; int sx, sy; }; void CreatMatrix(Matrix &m, int a, int b); void PrintMatrix(const Matrix &); void SummMatrix( const Matrix & m...

Перегрузка () - С++ для начинающих

cyberforum.ru - 2013-06-05 22:52:06 - Similar - Report/Block

Здарвствуйте, помогите с задачей: Имеется класс, создающий двумерный массив, в этом классе нужно реальзовать метод перегружающий () для того, что бы можно было доставать элемент из массива по его индексу [строка][столбец] Код: #ifndef _MATRIX_H_ #define _MATRIX_H_ #include #include #include using namespace std; class Matrix int **A, m, n...


Fill out the form you see below. Registration is free, fast and simple.
If you are already registered, sign in page login.

Web Site :
Required Field
First Name :
Required Field
Last Name :
Required Field
Email :
Required Field
Sex :
Required Field

evolveStar.com is free for ever !

evolveStar.com provides a search engine that allows you to gather information to write their own blog.

evolveStar.com enhances the sources displaying the logo of the site.

If you want to remove your site or you believe a site listed infringes copyright, please report it to: info@evolvestar.com

Specifies the subject copyright violation and the url of the page

evolveStar.com respecting the law DMCA (Digital Millennium Copyright Act) will immediately remove whatever its merits.

Next will be effectual and relevant checks.

Who We Are Partner Advertising Contacts Privacy terms Help & FAQ

© Copyright 2010-2017 Fabrizio Fichera. All rights reserved.