MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Manipulate with Matrices



With[{rows = 3, cols = 3, fieldSize = 5},
 Manipulate[
  Column[{TableForm@arr, Row[{"det = ", Det[arr]}]}]
  , {arr, None}
  , {initialized, None}
  , Row[{"                        column"}]
  , Evaluate@With[{
     makeRow = Function[{rowIndex},
       Join[{Row[{rowIndex, Spacer[4]}]}, 
        Map[Function[{colIndex}, 
          InputField[Dynamic[arr[[rowIndex, colIndex]]], Number, 
           FieldSize -> fieldSize, Enabled -> True]], Range[cols]]]
       , HoldAll
       ]
     },
    Grid[Join[
      {Join[{"row"}, Range[cols]]}
      , Map[makeRow, Range[rows]]
      ]]
    ]
  , Initialization :> ( 
    If[Not[initialized === True], arr = Table[0, {rows}, {cols}]]; 
    initialized = True )
  , SaveDefinitions -> True
  ]
 ]




  • Prev by Date: How do I create a circular lamina?
  • Next by Date: Re: mac new OS "mountain lion", compile function,
  • Previous by thread: How do I create a circular lamina?
  • Next by thread: Fitting part of a List