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

MathGroup Archive 2011

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

Search the Archive

Re: Column vectors should be interpreted as simple lists where

  • To: mathgroup at smc.vnet.net
  • Subject: [mg121332] Re: Column vectors should be interpreted as simple lists where
  • From: Christopher Young <cy56 at comcast.net>
  • Date: Sun, 11 Sep 2011 07:28:12 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <20110910115652.MZQ9L.1701997.imail@eastrmwml48>

On Sep 10, 2011, at 11:56 AM, Bob Hanlon wrote:

>
> MF[x_] := Map[Flatten, x]
>
> When using postfix notation you don't need to use a pure function form 
such as MF[#]&

Right, thanks. Actually, I think I needed a second argument, a level 
specifier in order to flatten column-vectors within a list of 
column-vectors. I use before but forgot in the version I mailed.

>
> Graphics[{
>  {Directive[Thick, Gray],
>   Line[Table[{{x}, {Sin[x]}}, {x, 0, 6.3, 0.1}] // MF]},
>  {Directive[Dashed, Blue],
>   Line[{{{2}, {0}}, {{2}, {Sin[2]}}, {{0}, {Sin[2]}}} // MF]},
>  {Directive[PointSize[0.02], Blue],
>   Point[{{2}, {Sin[2]}}] // MF}},
> Axes -> True]
>
> However, you don't need Flatten if you don't insert all of those 
extraneous brackets.
>
> Graphics[{
>  {Directive[Thick, Gray],
>   Line[Table[{x, Sin[x]}, {x, 0, 6.3, 0.1}]]},
>  {Directive[Dashed, Blue],
>   Line[{{2, 0}, {2, Sin[2]}, {0, Sin[2]}}]},
>  {Directive[PointSize[0.02], Blue], Point[{2, Sin[2]}]}},
> Axes -> True]
>
> Eliminating other extraneous material
>
> Graphics[{
>  {Thick, Gray,
>   Line[Table[{x, Sin[x]}, {x, 0, 6.3, 0.1}]]},
>  Dashed, Blue,
>  Line[{{2, 0}, {2, Sin[2]}, {0, Sin[2]}}],
>  PointSize[0.02],
>  Point[{2, Sin[2]}]},
> Axes -> True]
>
>
> Bob Hanlon

Chris Young
cy56 at comcast.net



  • Prev by Date: Re: execution model: Function vs. delayed execution
  • Next by Date: Re: help to make code run faster (mathematica v8.01)
  • Previous by thread: Column vectors should be interpreted as simple lists where
  • Next by thread: Re: Column vectors should be interpreted as simple lists where