Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Re: Input cells destroy Grids?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg124711] Re: Input cells destroy Grids?
  • From: Heike Gramberg <heike.gramberg at gmail.com>
  • Date: Thu, 2 Feb 2012 04:53:09 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201202010849.DAA15190@smc.vnet.net>

Maybe you could do something like

incel = {1, 2, 3, 4};
matrix = {{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}};
Style[Grid[{{MatrixForm[incel, TableDirections -> Row],
    ""}, {Outer[
      InputField[Dynamic[matrix[[##]]], Number, ImageSize -> 50] &,
      Range[4], Range[4]] // MatrixForm,
    Dynamic at MatrixForm[incel.matrix]}}], FontSize -> 40]

Heike


On 1 Feb 2012, at 09:49, Mark Green wrote:

> I'm trying to make a slide which will allow students to insert 
arbitrary numbers into a matrix multiplication, and have gotten this:
>
> incel = {1, 2, 3, 4};
> matrix = {{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}};
> Style[Grid[{{MatrixForm[incel, TableDirections -> Row],
>    ""}, {InputField[MatrixForm[matrix]], MatrixForm[incel.matrix]}}],
>  FontSize -> 40]
>
> It looks fine if I remove the InputField call, but with it in there, 
the input field takes up the entire width of the notebook, ignoring the 
fact there's supposed to be a grid cell to the right of it. Also, I have 
a feeling this won't work in FreeCDF because the input is of a matrix, 
not a number.
>
> Is there a better way of doing this that inputs only numbers and that 
fits in a grid?
>




  • Prev by Date: Re: Win7 "not responding"; WinXP no problem w/ my Manipulate
  • Next by Date: nonlinear curve fitting using orthogonal distance regression?
  • Previous by thread: Input cells destroy Grids?
  • Next by thread: Re: Input cells destroy Grids?