Tag Info

New answers tagged

5

Replacement rules make this much easier, as Ymareth indicated. Make a list of rules like: r2 = {"x" -> Checkbox[True], "o" -> Checkbox[False], "u" -> Checkbox[3, {1, 2, 3}]}; Then apply these to the matrix m as: m/.r2 Note that this code idiomatic Mathematica is imminently readable by anyone familiar with it. Nested For loops and term ...


2

There is a missing semicolon just behind the end of the outer For, just before the x, corrected below. addChekboxesTable[x0_] := Module[{x = x0}, For[i = 1, i <= Length[x], i++, For[j = 1, j <= Length[x[[i]]], j++, If[x[[i, j]] == "x", x[[i, j]] = Checkbox[True];] If[ x[[i, j]] == "o", x[[i, j]] = Checkbox[False];] If[ x[[i, ...


3

a = {{1, 1, 1}, {1, 0, 1}}; b = {6, 4}; Reduce[{a.{x, y, z} == b, x > 0, y > 0, z > 0}, {x, y, z}, Reals] (* 0<x<4 && y == 2 && z == 4-x *) Find one instance: FindInstance[{a.{x, y, z} == {6, 4}, x > 0, y > 0, z > 0}, {x, y, z}, Reals] (* {{x -> 2,y -> 2,z -> 2}} *) Find three instances: ...


2

This is really more of a comment, but it's too long. I would try to solve this starting with a smaller analogous problem. For instance, the n=2 version of this readily gives an answer: n = 2; sys = Flatten[Table[Table[Table[Table[ Sum[a[i, j, k] a[k, l, h] - a[j, k, l] a[i, l, h], {l, 1, n}] == 0, {h, 1, n}], {k, j, n}], {j, i, n}], {i, 1, ...



Top 50 recent answers are included