Questions on the manipulation of matrices in Mathematica.
0
votes
1answer
97 views
Get value only from Position
If have the following command
Position[{a, b, a, a, b, c, b}, b]
(* Out[1]= {{2}, {5}, {7}} *)
Is it possible to get only a sequence of values instead of this ...
1
vote
3answers
118 views
Convert coefficients of polynomials into a matrix
I have several sets of 5 polynomials of the form:
...
3
votes
1answer
223 views
Efficient method for inverting a block tridiagonal matrix
Is there a better method to invert a large block tridiagonal Hermitian block matrix, other than treating it as a ordinary matrix?
For example:
...
7
votes
2answers
154 views
How to generate a matrix group?
I have three $7\times 7$ matrices (with real entries, lots of zeros) and I'd like to check if they generate a finite group (or, more precisely, if the group they generate is of precise order). Would ...
4
votes
2answers
511 views
Solving a time-dependent Schroedinger equation
I want to solve the time-dependent Schroedinger equation:
$$
i\partial_t \psi(t) = H(t)\psi(t)
$$
for matrix, time-dependent $H(t)$ and vector $\psi$.
What is an efficient way of doing this so ...
1
vote
1answer
56 views
Is there a cleaner/shorter way to select-replace in matrices? [duplicate]
I love Mathematica, but I find it oddly lacking when it comes to how matrices are handled. Here is an example of code that works but seems like it should be a lot shorter (and minus the loop).
I'm ...
7
votes
2answers
154 views
Why does my matrix lose rank?
I want to check the rank of a matrix for observability, but Mathematica loses a rank if the matrix contains very large numbers.
Let's say my matrix is
...
4
votes
2answers
457 views
How to use a 3×3 covariance matrix to plot an error ellipsoid?
I have a 3×3 error covariance in Mathematica, but I don't know how to use it for plotting the error ellipsoid. It would be great if you can show me how I can do that for the below covariance matrix:
...
0
votes
0answers
58 views
Mapping a function to a Matrix [closed]
I’ve looked up previous answers to this question but haven’t found a suitable answer.
I am trying to Map a function that I defined across a Matrix. The function Maps fine across a 1D array but can’t ...
0
votes
1answer
95 views
2
votes
1answer
38 views
Replace a specified portion of an array with elements from another smaller array
This may be a trivial question, but I have been at it for a couple of hours and I have not made much progress.
I have a 10 x 10 array (T) that I have used to generate an 8 x 8 array (Q). I want to ...
0
votes
1answer
62 views
Why does Eigenvalues[matrix I defined] not work? [duplicate]
This is the code I have in my mathematica notebook. I want to find the eigenvalues of the matrix I created called Hmatrix as defined below. However when I type Eigenvalues[Hmatrix] I get the Hmatrix ...
0
votes
1answer
142 views
How to use Compile for accelerating matrix multiplications?
I am trying to find the inverse of the matrix $A$
m = n = 500;
SeedRandom[123456];
A = RandomReal[10, {m, n}];
iteratively using the following matrix ...
3
votes
1answer
133 views
How to get the determinant and inverse of a large sparse symmetric matrix?
For example, the following is a $12\times 12$ symmetric matrix. Det and Inverse take too much time and don't even work on my ...
-1
votes
1answer
119 views
An issue regarding Eigenvalues function [closed]
Can anybody please kindly explain to me why the members of the output vector produced by the following example are not equal to zero?
...
1
vote
1answer
79 views
Importing a matrix from a text file
I have a $4 \times N$ matrix in a .txt file of the form:
-17.071 137.567 16.554 0.65
-16.873 136.138 16.934 0.7
-15.397 135.738 16.894 0.7
-14.7 135.982 15.9 0.6
...
1
vote
3answers
168 views
How do I create a matrix of functions?
I'm trying to create a matrix in which the elements are functions of two variables, but I can't figure out how to do it. Is it possible? The only way I could figure out is to define the matrix in ...
2
votes
1answer
141 views
Solving an equation involving a determinant
I have a matrix which doesn't include numerical values. There are four variables in it. It is defined by
...
4
votes
2answers
209 views
All possible solutions to the Matrix Equation (free variables appearing)
I am attempting to solve a system of linear equations using LinearSolve[] . In my case, the number of unknowns are more than constraints. I learnt that LinearSolve ...
6
votes
3answers
162 views
Permanent minors
The function Minors yields the minors of a matrix. Is there a function that yields the permanent minors of a matrix?
11
votes
1answer
426 views
Eigenvalues and Determinant of a large matrix
Can anybody kindly explain to me what is going wrong regarding a simple problem I have? I can find the eigenvalues of a large matrix using Eigenvalues[], but when I ...
1
vote
1answer
66 views
Confirming the existence of a function related to a matrix
Is it possible to get an answer to the following question in Mathematica?
Let $M$ be a $n$ by $n$ matrix, is there a function $m:\mathbb{N}\times \mathbb{N}\rightarrow \mathbb{Z}$ such that ...
3
votes
1answer
301 views
TensorContract of inverse matrix
Matrix inverse in mathematica
If $A$ is an invertible $n \times n$ matrix, then $A\cdot A^{-1} = I$.
To get this statement in Mathematica, you need the assumption
...
4
votes
2answers
132 views
How to use “Drop” function to drop matrix' rows and columns in an arbitrary way?
The built-in function "Drop" can delete a Matrix's row and column.
Typical syntax for "Drop" is as follows:
Drop[list,seq1,seq2...]
But what if I want to drop a ...
3
votes
0answers
71 views
How to accelerate updating some parts of sparse matrices?
I am trying to update some parts of an specific matrix as rapidly as possible. In what follows, I first set up the basics things that I want to use
...
6
votes
1answer
101 views
How to calculate only four elements per column in a block matrix?
I have a matrix generated like this :
Table[Sequence @@ {f[t[[i]], j, x], g[t[[i]], j, x]}, {i, 16}, {j, 3}]
where $f$ and $g$ are two different functions, $t$ ...
7
votes
3answers
124 views
Multiply a list of matrices by a list of vectors
How does one multiply a list of matrices by a list of vectors, elementwise? For example, multiplying
...
0
votes
0answers
105 views
How Simplify and Assume can be combined on matrix products?
What I am trying to do is to simplify some expressions involving matrices! The problem is that Simplify[] considers the simplifications based on alphabetical order and everything is Commutative. For ...
9
votes
1answer
109 views
inverse of abstract matrix
If you assume the matrix $A$ is invertible, then $A^{-1} \cdot A = I$.
Is there an assumption for invertibility in Mathematica 9? How can one make the following evaluate to the identity matrix $I_3$?
...
9
votes
2answers
202 views
Speed up 4D matrix/array generation
I have to fill a 4D array, whose entries are $\mathrm{sinc}\left[j(a-b)^2+j(c-d)^2-\phi\right]$ for a fixed value of $\phi$ (normally -15) and a fixed value of $j$ (normally about 0.00005). The way ...
14
votes
2answers
342 views
How to form a block-diagonal Matrix from a list of matrices? [duplicate]
like this:
I know join[...] works, but it is a bit troublesome for multiple matrices.I tried DiagonalMatrix[...], but DiagonalMatrix can only form matrix from a list of elements.
3
votes
3answers
205 views
How to transform and swap columns of this matrix in a simple way? Version 2
So, earlier today I asked the question
How to transform this matrix & swap its columns in a simple way?
and was given useful and elaborated answers. Now, I'm still not used to the "Array", ...
0
votes
2answers
172 views
How to get complement from two matrices?
This is a special case of my question How to do nor on matrices?
...
3
votes
4answers
221 views
How to transform this matrix & swap its columns in a simple way?
I would like to transform matrix $\mathbf A = \begin{pmatrix} a&b&i&j\\ c&d&k&l \\ e&f&m&n \\ g&h&o&p \end{pmatrix}$ into matrix $\mathbf B = ...
0
votes
1answer
133 views
How to do nor on matrices?
Supose I have matrices a b and c like
a = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
b = {7, 8, 9};
c = {{1},{4},{7}};
I want to get ...
1
vote
2answers
195 views
badly conditioned matrix (General::luc)
With some matrices I am receiving the following message
Inverse::luc Result for Inverse of badly conditioned matrix (M) may contain significant numerical errors.
How can I tell to Mathematica to ...
0
votes
1answer
728 views
Quick Hessian matrix and gradient calculation?
I am absolutely new to Mathematica and I actually want to try implementing a little optimization method .
Long story short assuming I have a predefined two-variable function f(x,y) I want to ...
2
votes
1answer
127 views
Can I reduce a matrix inequality such as $\mathbf x^\prime\mathbf A\mathbf x > \mathbf x^\prime\mathbf x$?
I'm new to Mathematica. When I do linear algebra, I wonder if I can have an inequality such as $\mathbf x^\prime\mathbf A\mathbf x > \mathbf x^\prime\mathbf x$, where $\mathbf x$ is a column vector ...
0
votes
1answer
108 views
Discrete 3D plots of median ratios of two 2D matrices of lists of values
Lets say I have 2 2D arrays where each cell contains a list of values:
Example:
...
0
votes
0answers
42 views
Inverting a matrix [duplicate]
Possible Duplicate:
Why does MatrixForm affect calculations?
I am facing a strange behaviour from Mathematica when asking it to invert the following matrix:
...
3
votes
1answer
66 views
Efficiently finding the maximum value of a column in a matrix
Imagine I have a matrix of the following form:
TestArray = $((a_1,b_1,...),(a_2,b_2,...),(a_3,b_3,...),...)$, where a specific example might be:
TestArray = ...
1
vote
3answers
142 views
More than one expression in the Table[] command?
I would like to construct a Matrix using the Table[] command. The issue is that I would like to use more than one expression for it. What I need to obtain is something like this :
...
4
votes
1answer
100 views
How to define and compute various properties of a variable size matrix
I have a rather simple question, but I have not been able to figure out how to implement a solution in Mathematica. I would like to define a variable size square matrix, say an N x N matrix A, whose ...
2
votes
2answers
132 views
How can I shift the frame ticks to the corner of each element-cell in a Matrixplot?
I am using the following code,to create a Legend for my plot. I would like to shift (or re-position) the frameticks to the corner of each of the cell-elements instead of being in their middle. I ...
0
votes
0answers
64 views
Trying to access element of a matrix [duplicate]
Possible Duplicate:
Question about MapThread and Dynamic
I'm trying to extract element of a matrix. Let's suppose that the matrix is
...
3
votes
2answers
231 views
Dynamic matrix multiplication
I have the following problem:
I want to multiply two matrices and sum them to another matrix C. A.B+ 2B Easy!
The matrix A varies as a function of three inputs a,b and c. The second matrix, B, is a ...
1
vote
1answer
124 views
How do I compose two functions (matrices) in Mathematica? [closed]
I'm new to Mathematica. I've been reading the 'Documentation Center' but can't find a clue about composing two functions which in my case are matrices.
Here's the setup. let ...
0
votes
0answers
61 views
please help to me, Where is my mistake? [closed]
e = {{v, -37925.9}, {-37925.9, s}}
v = (37925.9 - 12.74 x)
s = (7585108 - 15029 x)
Solve [e == 0 , x ] please help to me, Where is my mistake?
10
votes
2answers
182 views
Compiling LinearSolve[] or creating a compilable procedural version of it
Earlier today I had a discussion with a representative at Premier Support about the 2 questions I've asked here over the past couple of days:
Seeking strategies to deploy a function securely ...
8
votes
2answers
191 views
Correct way to generate large data sets (i.e.forward yield curve )
I would like to generate a set of forward yield curve matrix of size 1000 x 100. First I defined my SparseArray of 1000 x100:
...


