I need to be able to input and output 2-D matrices (normally numeric) in a form independent of the programming language used to process them. I have adopted the approach below and want to check whether there are any agreed conventions that support or contradict this.
Specifically I have an XML representation of the form (which is requir...
Hey,
What's the best way to create an asp.net page with a data matrix. Imagine an excel sheet where the rows have a dynamic amount of cells, but the number of cells must be the same for each row. The default number would be for example 9.
The user should be able to edit, add or remove each row separately. Upon with the appropriate chan...
Hi All,
So i have a set of four points in 3D Space.
P1 [0, 0, 0]
P2 [128, 0, 0]
P3 [0, 128, 0]
P4 [128, 128, 0]
Which I'm then projecting orthographically to the screen effectively giving me two wireframe triangles in screen space.
I now want to map a texture to this "plane" comprised of the two triangles. So i take my square...
This one has me stumped, and none of the other related questions here have given me clues. I'm using regexp to parse a string. When I print t afterward, it looks something like this:
t =
{
[1,1] =
{
[1,1] = HELLO
[1,2] = 1234
}
}
I would like to be able to pull out the HELLO and 1234. I've tried all different ways to ...
Is there an easy way to divide each matrix element by the column sum? For example:
input:
1 4
4 10
output:
1/5 4/14
4/5 10/14
...
I have two masks that I would like to merge together, overwriting mask1 with mask2 unless mask2 has a zero. The masks are not binary, they are some value that is user defined in the region of interest and 0 elsewhere.
For example if:
mask1=[0 5 5;0 5 5];
mask2=[4 4 0;4 4 0];
then I would want an output of [4 4 5;4 4 5]. And if I then...
Dear SO,
I'm trying to write an implementation of Wilson's spectral density factorization algorithm [1] for Python. The algorithm iteratively factorizes a [QxQ] matrix function into its square root (it's sort of an extension of the Newton-Raphson square-root finder for spectral density matrices).
The problem is that my implementation o...
I thought this problem had a trivial solution, couple of for loops and some fancy counters, but apparently it is rather more complicated.
So my question is, how would you write (in C) a function traversal of a square matrix in diagonal strips.
Example:
1 2 3
4 5 6
7 8 9
Would have to be traversed in the following order:
[1],[...
Hi,
I'm trying to write a matrix into a text file.
In order to do that I'd like to know how to write an array into a line in the text file.
I'll give an example:
int [] array = {1 2 3 4};
I want to have this array in text file in the format:
1 2 3 4
and not in the format:
1
2
3
4
Can you help me with that?
Thanks a lot
...
Hi,
I have a many to many table in MySQL - it can look something like:
A | B
1 | 1
1 | 2
1 | 3
3 | 4
3 | 5
4 | 1
4 | 2
4 | 5
etc.
You'll notice that the numbers are not always contiguous, (A=1,3,4..) - I am looking for the fastest way to turning this into a matrix table, ignoring columns and rows with no data (e.g. A=2). What I have...
I have a matrix in MATLAB from which I want to sample every other entry:
a =
1 5 9 13
2 6 10 14
3 7 11 15
4 8 12 16
And I want:
result =
1 9
3 11
How can I do this without a for loop?
...
I try to calculate a problem with 20000 points, so there is a distance matrix with 20000*20000 elements, how can I store this matrix in C++? I use Visual Studio 2008, on a computer with 4 GB of RAM. Any suggestion will be appreciated.
...
Hi all,
Here's something I'm trying to figure out concerning display objects in ActionScript3 / Flex.
Let's say you have a display object who's registration point is in the top left and you want to scale it from its center (middle of the display object), How could you easily acheive this with the flash.geom.Matrix class
Thanks for you...
I have two matrices. Both are filled with zeros and ones. One is a big one (3000 x 2000 elements), and the other is smaller ( 20 x 20 ) elements. I am doing something like:
newMatrix = (size of bigMatrix), filled with zeros
l = (a constant)
for y in xrange(0, len(bigMatrix[0])):
for x in xrange(0, len(bigMatrix)):
for b in...
I saw this question,and pop up this idea.
Is there an efficient way to do this in PHP?
EDIT
Best with a demo?
...
Say I have a matrix of ones and zeros, and I would like a 'identifier' for this matrix that takes the same value regardless of whether the matrix is rotated by 90, 180, or 270 degrees, i.e. a 4-to-1 mapping. Ideally, this identifier should be 1/4 the size of the matrix. Is it possible to write a function that does this mapping?
Backgrou...
Let's say I have a 100x100 matrix, I want to divide it into equals parts of 10x10.
The problem is that the input matrix can be of any size but always mod 10.
I looked at the mat2cell function but it does not seem to work for a dynamic number of parts.
Or am I missing something?
Thanks!
...
I have the following C++ matrix class:
transform.h transform.cpp
I am using this coupled with a renderer, for which there is an opengl and a directx implementation.
I have a test example where the coordinates of the mouse within the window are used to position a graphic under the cursor. This works as expected under OpenGL.
Because d...
My matrix has a row group (QuestionText) and a Column Group (AnswerText).
It looks like this:
[AnswerText]
[QuestionText] [AnswerCount]
My Data looks like this:
QuestionText AnswerText AnswerCount
Question 1 Yes 2
Question 1 No 1
Question 2 Yes 3
Question 2 ...
Is there a function to get an index (row number and column number) for a matrix?
Suppose that I have a simple matrix:
a <- matrix(1:50, nrow=5)
Is there an easy way to get back something like c(3, 5) for the number "23", for instance? In this case, saying which(a==23) just returns 23.
This seems to work but I'm sure that there'...