Given:
h_i=t_(i+1)-t_i for i=1,...,n-1 where n is a positive integer.
The matrix Q is an n by (n-2) matrix with entries q_(i,j) with i=1,...,n and j=2,...n-1 given by:
q_(j-1,j)=1/h_(j-1)
q_(j,j)=-(1/h_(j-1)+1/h_j)
q_(j+1,j)=1/h_j
q_(i,j)=0 for |i-j|>=2
I want to get a matrix Q. How do i write a program for this matrix in R? Many t...
Hi all,
I am really new with matlab and would like some helps with matlab..
Here is the problem:
Say if i have a 256 by 256 matrix. I would like to replace any values that are 'greater' or 'equal' to
10 with 'one' and name the rest as 'zero' i.e. (values <10).. How can I do it??
For example,
2 3 6 15 24 32 1 7 39 10....
1 5 7 11 19...
I am using numpy. I have a matrix with 1 column and N rows and I want to get an array from with N elements.
For example, if i have M = matrix([[1], [2], [3], [4]]), I want to get A = array([1,2,3,4]).
To achieve it, I use A = np.array(M.T)[0]. Does anyone know a more elegant way to get the same result?
Thanks!
...
Hello!
I am passing data from C# to R over a COM interface. When the data arrives in R it is housed in a 'Matrix'. Some of the functions that I use require that the data be inside a 'DataFrame' instead. I convert the data structure using
newDataFrame <- as.data.frame(oldMatrix)
The table of data reaches R just fine, once I make the...
I have a lot of elements in a matrix and when I access them manually it takes a pretty long time to eliminate all the bugs arising from wrong indexing... Is there a suitable library that can keep track of e.g the neighbors,the numbering, if an element is in the outer edge or not and so on.
e.g.
VA=
11 12 13 14
21 22 23 24
31 32 33 34
4...
Im trying to do a simple rotation of a cube about the x and y axis:
I want to always rotate the cube over the x axis by an amount x
and rotate the cube over the yaxis by an amount y independent of the x axis rotation
first i naively did :
glRotatef(x,1,0,0);
glRotatef(y,0,1,0);
then
but that first rotates over x then rotates over ...
Hi I've been doing some research about matrix inversion (linear algebra) and I wanned to use c++ template programming for the algorithm , what i found out that there are number of methods like: Gauss-Jordan Elimination or LU Decomposition and I found the function LU_factorize (c++ boost library)
I want to know if there were other metho...
Greetings,
googling for that subject brings, e.g., MTL, exmat, LAPACK and also here. I also seem to remember that Microsoft Research released one, but can't put my hands on it.
I look for advice from someone who actually used (or developed...) one of those, hoping to achieve a Matlab experience inside C++ (as much as possible).
Thanks in...
The following is the overriden dispatchDraw in a subclass of SurfaceView. I'm trying to change the parameters of the Surface(getting only a subsection of the video preview.
@Override
public void dispatchDraw (Canvas canvas) {
Log.d(TAG,"**************inside dispatchDraw************");
int VIEW_WIDTH = canvas.ge...
Hello,
I am trying to loop over the a matrix and do the correlation coefficiency of each two-row and print out the correlation matrix.
ID A B C D E F G H I
Row01 0.08 0.47 0.94 0.33 0.08 0.93 0.72 0.51 0.55
Row02 0.37 0.87 0.72 0.96 0.20 0.55 0.35 0.73 0.44
Row03 0.19 0.71 0.52 0.73 0.03 0.18 0.13 0.13 0.30
Row04 0.08 0.77 0.89 0.12 0...
Setup:
I have a boolean matrix e.g.
1 0
1 1
0 1
where rows are named m1, m2, m3 (as methods) and columns t1 and t2 (as tests).
Definition:
An explanation is a set of rows (methods) which in union have at least one "1" in any column (every test hast to be matched by at least one method).
in our example, the set of explanations ...
Thanks Nico! Almost got there after I corrected small bugs. Here I attache my script:
datamatrix=read.table("ref.txt", sep="\t", header=T, row.names=1)
correl <- NULL
for (i in 1:nrow(datamatrix)) {
correl <- apply(datamatrix, 1, function(x) {cor(t(datamatrix[, i]))})
write.table(correl, paste(row.names(datamatrix)[i], ".txt", sep...
I need to get rotation data from Bullets rigid body world transform ( getWorldTransform() ) to the suitable format to pass to D3DXMatrixRotationYawPitchRoll function to generate the rotation matrix for DirectX.
My solutions structure is built up this way so I need to pass the data this way. You can provide other solutions, maybe I can s...
How do I create code for collision detection on a bitmap rotated by a matrix?
canvas.drawBitmap(mAnimation, mainMatrix, null);
mainMatrix is derived from a PathMeasure so i do not know the rotation
The bitmap is rotated around x=0,y=0 and thus a circle around the centre will not work (or at least be too big)
thanks
...
Im trying to solve Problem 11 of Project Euler in haskell. I almost did it, but right now im
stuck, i want to transform a Matrix represented as [String] to a Matrix represented as [[Int]].
I "drawed" the matrices:
What i want:
"08 02 22 97 38 15 00 40 [ ["08","02","22","97","38","15","00","40"], [[08,02...
Based on the documents
http://www.gnu.org/software/gsl/manual/html_node/Householder-Transformations.html
and
http://en.wikipedia.org/wiki/Householder_transformation
I figured the following code would successfully produce the matrix for reflection in the plane orthogonal to the unit vector normal_vector.
gsl_matrix * reflection = gsl...
Hi there! I'm a real noob who just started learning 3d programming and i have a really hard time learning about rotation in 3D space. My problem is that I can't seem to figure out how to rotate an object using it's local coordinates.
I have a basic class for 3d objects and, for starters, i want to implement functions that will rotate th...
For a summary I want to display a latex matrix in an as compact as possible way. How can I do that?
...
Is there a package in MATLAB, Maple or Mathematica which does this?
...
I am essentially trying to take a matrix a and turn it into a matrix af which has the values in the first three columns of a. I just want to prune a matrix a down to only its first three columns.
...