Questions on the manipulation of matrices in Mathematica.
8
votes
1answer
701 views
Bordermatrix from LaTeX
How would I create an output similar to the result produced by this LaTeX code:
...
4
votes
1answer
62 views
Trouble using FindInstance with MatrixRank
I'm really confused about what's going wrong with my call to FindInstance:
...
14
votes
2answers
480 views
Using the Krylov method for Solve: Speeding up a SparseArray calculation
I'm trying to implement this Total Variation Regularized Numerical Differentiation (TVDiff) code in MMA (which I found through this SO answer): essentially I want to differentiate noisy data. The full ...
7
votes
3answers
324 views
Add lists with unequal lengths together to create a matrix
I'm trying to create a stacked bar chart using raw data coming from a MySQL server. The result coming back from one query is:
...
6
votes
0answers
223 views
MMA implementation of Earth Movers Distance?
Has anyone implemented in MMA the Earth Mover's Distance (EMD)? A concept dating back to Monge 1871, used to compare histograms and images, e.g., the CIEDE2000 Color Difference algorithm. Yossi ...
27
votes
6answers
1k views
How to visualize/edit a big matrix as a table?
Is it possible to visualize/edit a big matrix as a table ? I often end up exporting/copying big tables to Excel for seeing them, but I would prefer to stay in Mathematica and have a similar view as in ...
2
votes
3answers
577 views
Orthonormalization of non-hermitian matrix eigenvectors
When using Orthogonalize[] one can specify which definition of "inner product" is to be used. For example, ...
6
votes
2answers
375 views
Entering block matrices for an arbitrary matrix size
Background: How to enter matrices in block matrix format? and the following:
I want to create
$$
f(A,t) = \left [
\begin{matrix}
A & t \\
0 & 1
\end{matrix} \right ]
$$
where $A$ ...
15
votes
4answers
433 views
How do I generate the upper triangular indices from a list?
I have some list
{1,2,3}.
How do I generate nested pairs such that I get
{{1,2},{1,3},{2,3}}?
That is I'd like a way to ...
1
vote
0answers
240 views
Matrix multiplication involving MatrixForm [duplicate]
Possible Duplicate:
Why does MatrixForm affect calculations?
I am doing a matrix multiplication, but not getting the desired output. I am doing the matrix multiplication of $A^{-1}B$ from ...
17
votes
4answers
742 views
Why does MatrixForm affect calculations?
This is a really newbie question, but it has me confused. Why does this code work without // MatrixForm and doesn't work with ...
30
votes
6answers
4k views
Elegant operations on matrix rows and columns
Question
The Mathematica tutorial has a section 'Basic Matrix Operations', describing operations like transpose, inverse and determinant. These operations all work on entire matrices. I am missing a ...
3
votes
4answers
3k views
Creating a table/Matrix during a For loop
I have a For loop (with i as a counter), which calculates different values (y1, ...
29
votes
6answers
2k views
Does Mathematica have advanced indexing?
I have two $M \times K$ arrays $L, T$ where I would like to set all the elements in $L$ to zero whenever the corresponding element of $T$ is greater than 15. The ...
9
votes
4answers
1k views
How can I multiply matrix and vector element wise like Numpy?
I have an $M \times K$ matrix $C$ and a length $K$ vector $v$. I want to form the $M \times K$ matrix $S$ where $s_{ij} = C_{ij}/v_j$. To do this in numpy I simply divide the two objects like this
...
18
votes
2answers
944 views
Cycles of length N in a graph
If I have an undirected graph represented with an adjacency matrix, how can I find all the subgraphs which are a cycle of length N?
I don't really know the math nor the programming language well, so ...
4
votes
3answers
475 views
Trying to simplify Root expressions from the output of Eigenvalues
I am trying to calculate eigenvalues of a sparse matrix with only two distinct non-zero elements, here Alpha and Beta, which are both negative reals. Mathematica returns some complex expressions with ...
12
votes
4answers
638 views
What is the right way to rotate an array?
Suppose I have an array, not necessarily square:
a = $\left(
\begin{array}{ccc}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
\end{array}
\right)$
I want to rotate it like one ...
16
votes
3answers
297 views
How to improve this code for exploring large matrices?
What I'm actually trying to do is to elaborate this question. I'd like to use Pane with scrollbars enabled to explore large (sparse) matrices like this one:
Here ...
10
votes
1answer
350 views
Nesting Parallel processes
I just attempted to run code that had nested ParallelMap[] functions. It generates the error message:
ParallelMap::subpar: Parallel computations cannot be nested;
proceeding with sequential ...
7
votes
1answer
482 views
How to apply a permutation to a symmetric square matrix?
Given a symmetric square matrix, how can I apply a permutation to the rows and columns (i.e. the same permutation to both the rows and the columns) such a way that the new structure of the matrix ...
5
votes
1answer
801 views
Simpler way of performing Gaussian Elimination?
Is there a simpler way of performing Gaussian Elimination other than using RowReduce? Such as a single built in function?
Edit: Look at the example from our simulation class. Not too difficult, but ...
12
votes
4answers
502 views
What is the fastest way to locate an image inside a larger image?
let b =
let c =
How to do:
find[c,b]
that returns the bounding box of c in b?
...
3
votes
1answer
253 views
Take[] and other Mathematica functions with live streams
I have a live video feed that I would like to convert into raw numbers that could be used for a variety of different things. I would also like to do simple operations on these numbers live with as ...
14
votes
2answers
991 views
How to enter matrices in block matrix format?
Example:
I have a matrix $R = \left( \begin{array}{cc}
A & \mathbf{t} \\
0 & 1 \end{array} \right) $ where $A$ is 3-by-3 and $\mathbf{t}$ is 3 by 1. Or in Mathematica
...
4
votes
2answers
330 views
Why don't * and ^ work as I expected on matrices?
For example, this input...
{{1, 2}, {3, 4}}*{{1, 2}, {3, 4}}
produces this output...
{{1, 4}, {9, 16}}
and this input...
...
19
votes
5answers
996 views
What is the most efficient way to add rows and columns to a matrix?
Say I have a matrix m and a vector v.
...
16
votes
3answers
1k views
How to symbolically do matrix “Block Inversion”?
Consider a block (partitioned) matrix
matrix = ArrayFlatten[{{a, b}, {c, d}}]
where, a, ...
