Tag Info

New answers tagged

1

Will this do? A = Table[a[i,j],{i,3},{j,3}]; Then you can have p[x_, y_] := Sum[Sum[A[[i, j]]*x^i*x^j, {j, 1, 3}], {i, 1, 3}]; and you will have e.g.: Dimensions[A] {3,3} This is essentially what bill s proposes, but I am wrapping the symbolic a[i,j] in a matrix A.


1

Here is one way to keep everything symbolic: p[x_, y_] := Total@Flatten@Table[a[i, j] x^i y^j, {j, 1, 3}, {i, 1, 3}] p[3, 4] 12 a[1, 1] + 48 a[1, 2] + 192 a[1, 3] + 36 a[2, 1] + 144 a[2, 2] + 576 a[2, 3] + 108 a[3, 1] + 432 a[3, 2] + 1728 a[3, 3] Of course, you can assign values to the a[i,j] in order to get numerical values for the polynomial.


2

mat = {{{1, 0.4, 0, 0, 0, 0}, {2, 0.5, 0, 0, 0, 0}, {3, 0.2, 0, 0, 0, 0}}, {{3, 0.2, 1, 5.5686, 23.618, 1}, {2, 0.5, 0, 0, 0, 0}, {1, 0.4, 0, 0, 0, 0}} , {{2, 0.2, 0, 5.5686, 23.618, 1}, {3, 0.5, 0, 0, 0, 0}, {1, 0.4, 0, 0, 0, 0}}}; You can use #[[Ordering[#]]] & /@ mat or Sort /@ mat or Map[Sort, mat] all give (* { {{1, ...


0

If the lists are all the same length Transpose[Flatten /@ {a, b, c}] But beware that for ragged lists (i.e., those with sub-lists that are not all the same length) Transpose will not work and you have to use Flatten again. a = {{0}, {1}, {{2}}, {3}}; b = {{4}, {5}, {6}}; c = {7, 8, 9}; Flatten[Flatten /@ {a, b, c}, {2}] Transpose::nmtx: The first ...


1

The lists "a" and "b" are nested lists. With the Flatten option, the nested lists my be flattened and the nesting removed. The answer is, as posted from Öskå, to use the Flatten[]-command before the Transpose[]-command is executed.


2

You'd need to row reduce the intersection set to remove linear dependencies it might have. The code below should handle this. getIntersectionBasis[] := {} getIntersectionBasis[{}] := {} getIntersectionBasis[{}, __] := {} getIntersectionBasis[__, {}] := {} getIntersectionBasis[l1_] := getIntersectionBasis[l1, l1] getIntersectionBasis[l1_, l2_, l3__] := ...



Top 50 recent answers are included