Tag Info

Hot answers tagged

4

You can use CoefficientArrays: xx = {a[0, 0], a[0, 0] + a[1, 0] + a[2, 0] + a[3, 0], a[0, 0] + a[0, 1] + a[0, 2] + a[0, 3], a[0, 0] + a[0, 1] + a[0, 2] + a[0, 3] + a[1, 0] + a[1, 1] + a[1, 2] + a[1, 3] + a[2, 0] + a[2, 1] + a[2, 2] + a[2, 3] + a[3, 0] + a[3, 1] + a[3, 2] + a[3, 3], a[1, 0], a[1, 0] + 2 a[2, 0] + 3 a[3, 0], a[1, 0] + a[1, ...


4

The suggestions bar tries to offer a useful set of follow-up operations based upon the type of a result. In the case at hand, the result is a list of lists. But it so happens that all of the sublists are the same length, which happens to be the representation of a matrix in Mathematica. So the suggestions bar has guessed that the user has a matrix in mind ...


3

ClearAll[a, b, c, x, y, z, list, func]; list = {{x1, y1, z1}, {x2, y2, z2}, {x3, y3, z3}}; func[x_, y_, z_, a_, b_, c_] := {a, b, c}.{x, y, z} func[##, a, b, c] & @@ list[[1]] (* a x1+b y1+c z1 *) func[## & @@ #, a, b, c] &@list[[1]] (* a x1+b y1+c z1 *) func[##, a, b, c] & @@@ list (* {a x1+b y1+c z1,a x2+b y2+c z2,a x3+b y3+c z3} *) ...


3

One way is to start with empty matrix. Add the first column. Then loop, each time adding the next column, and checking if the rank of this matrix has increased from before, if so, keep it, else skip over to the next column. Keep doing this until you reach the last column in the original matrix, or have collected m columns, where m is the rank of the original ...


3

If RowReduce won't help, then perhaps I don't know what you're looking for. Here's my understanding of the question in which I use RowReduce to get the answer. Example A random matrix: SeedRandom[1]; mat = RandomSample[#~Join~Accumulate@RandomSample[#, 2] &@ RandomInteger[{-5, 5}, {35, 37}]]; MatrixRank[mat] (* 35 *) We can use the ...


2

You can also use a more "mathy" approach: Assuming xx and alpha are defined as in kguler's answer, A = D[xx, {alpha}] which produces identical output. I like thinking in this way because it is useful for computing hessians (in a slightly different context).


1

Perhaps this is a way: am = IdentityMatrix[3]; cm = {{c, c, c, c, c}, {d, d, d, d, d}, {e, e, e, e, e}}; dm = IdentityMatrix[5] ArrayFlatten[ Normal[SparseArray[{{1, 1} -> w[am], {1, 6} -> w[cm], {6, 1} -> w[Transpose@cm], {6, 6} -> w[dm]}, {6, 6}]] /. w -> Sequence] // MatrixForm where w is just a wrapper to allow ...



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