Re: make matrix animate
- To: mathgroup at smc.vnet.net
- Subject: [mg24921] Re: make matrix animate
- From: "P.J. Hinton" <paulh at wolfram.com>
- Date: Sun, 20 Aug 2000 01:35:12 -0400 (EDT)
- Organization: Wolfram Research, Inc.
- Sender: owner-wri-mathgroup at wolfram.com
On 19 Aug 2000, Borut L. wrote: > I made a function that has many matrices as output. It's in fact puzzle 15 > board, where in sequent matrices zero (blank space) moves > left/right/up/down. Is there a way to make a graphical animation (like > Do[Plot[...) with my output? Here is a possible approach for your problem, if your matrices contain character data. matrixPicture[mat_?MatrixQ, opts___?OptionQ] := Graphics[Text[DisplayForm[MakeBoxes[MatrixForm[mat]]], {0, 0}], TextStyle -> {opts}] This example generates several matrices as a sequence of graphics, which may be animated just like any other group of Graphics style cells. Scan[Show, Table[matrixPicture[{{i, i^2}, {i^3, i^4}}, FontSize -> 36], {i, 7}]] If you are dealing with a matrix of colors, you are better off using the Raster[] or RasterArray[] primitives. See the Cellular Automata notebook in the online demos to see one could write some visualization functions for this purpose. FrontEndExecute[ FrontEnd`HelpBrowserLookup[ "GettingStarted", "Cellular Automata" ] ] -- P.J. Hinton User Interface Programmer paulh at wolfram.com Wolfram Research, Inc.