Tag Info

Hot answers tagged

6

The compatibility information at Compatibility/tutorial/LinearAlgebra/MatrixManipulation says These functions were available in previous versions of Mathematica and are now available on the web at library.wolfram.com/infocenter/MathSource/6770: LinearEquationsToMatrices InverseMatrixNorm ConditionNumber You can download the original package ...


5

The two eigenvalues are degenerate. In general whenever you have degenerate eigenvalues there is arbitrariness in how to select the eigenvectors. You can construct a constant vector from the two degenerate eigenvectors like so: m = Import["https://dl.dropboxusercontent.com/u/63413473/ExampleMatrix.mx"]; {evals, evecs} = Eigensystem[m, -2]; You can check ...


4

The problem here can arise because of numerical underflow which appears for sufficiently large dimension of the problem. Some numerically very small number multiplies the parameter "a" and therefore "a" does not appear in the "solution". Consider a simple example Define the matrix m (fill it with random numbers, here exponentially distributed) In[263]:= ...


4

The LinearAlgebra package has been deprecated since Mathematica 5, and is no longer bundled with Mathematica 9 or newer. You can still download a part of it (which contains the MatrixConditionNumber function) at the URL that jtbandes gave in his answer. First, we need to load the package: (* Be sure to install the above linked package in a "LinearAlgebra" ...


2

For any square matrix M which is the sum of two similar matrices M = A + B the determinant can be written as a sum of determinants as follows (example for two dimensions): det(M) = det( ( A11 + B11, A12 + B12), (A21 + B21, A22 + B22) ) = det( ( A11 + 0, A12 + 0), (A21 + B21, A22 + B22) ) + det( ( 0 + B11, 0 + B12), (A21 + B21, A22 + B22) ) and, ...


1

Much has already been said about this problem, but maybe this solution still might be helpful. First we define an auxiliary vector In[18]:= va = Array[a, 3] Out[18]= {a[1], a[2], a[3]} with which it is trivial to calculate the cross product: In[19]:= Cross[va, {1, 2, 3}] Out[19]= {3 a[2] - 2 a[3], -3 a[1] + a[3], 2 a[1] - a[2]} Now we replace the ...


1

one way (if I understand you right) Clear[i, j]; n = 10; {upper, lower, diag} = RandomReal[1, {3, n}]; mat = SparseArray[{{i_, j_} /; j == (i + 1) :> upper[[j]], {i_, j_} /; j == (i - 1) :> lower[[i]], {i_, j_} /; j == i :> diag[[i]]}, {n, n}];


1

As Oska has commented N is a protected symbol. Some other approaches: n = 4; mat = ConstantArray[1, {n, n}]; ReplacePart[mat, {{2, 3} -> 23, {4, 3} -> 43}] gives: {{1, 1, 1, 1}, {1, 1, 23, 1}, {1, 1, 1, 1}, {1, 1, 43, 1}} or Normal@SparseArray[{{2, 3} -> 23, {4, 3} -> 43}, {n, n}, 1] gives: {{1, 1, 1, 1}, {1, 1, 23, 1}, {1, 1, 1, 1}, ...


1

n = 4; A = ConstantArray[1, {n, n}] A[[2, 3]] = 23; A[[4, 3]] = 43; A {{1,1,1,1},{1,1,1,1},{1,1,1,1},{1,1,1,1}} {{1,1,1,1},{1,1,23,1},{1,1,1,1},{1,1,43,1}} n = 4; A = ConstantArray[1, {n, n}]; (A[[Sequence @@ #]] = FromDigits@#) & /@ Flatten[Table[{i, j}, {i, 1, 4}, {j, 1, 4}], 1]; A // MatrixForm $\left( \begin{array}{cccc} 11 & 12 & ...



Only top voted, non community-wiki answers of a minimum length are eligible