Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1995

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

Search the Archive

Re: Function?

  • To: mathgroup at
  • Subject: [mg2816] Re: [mg2810] Function?
  • From: Allan Hayes <hay at>
  • Date: Wed, 20 Dec 1995 01:16:11 -0500

hans.steffani at (Hans Steffani)
>Subject: [mg2810] Function?
wishes to simplify the following code

	    Table[norm[ w[[i,j]]-fx ] , {i,wsize},{j,wsize} ],
            Min[Table[norm[ w[[i,j]]-fx ] , {i,wsize},{j,wsize}]]

Here are two ways (the fourth entry in Position, after the level  
specification, {1}, stops the search when one example has been  
found). I leave the answer as a list in case it is empty.

      With[{tab = Table[norm[ w[[i,j]]-fx ] , {i,wsize},{j,wsize} ]},
        Position[tab, Min[tab], {1}, 1]

      Position[#, Min[#],{1}, 1]&[
      	Table[norm[ w[[i,j]]-fx ]{i,wsize},{j,wsize} ]

Allan Hayes
hay at

  • Prev by Date: Programming
  • Next by Date: shell command
  • Previous by thread: Function?
  • Next by thread: Function parameters, using : and ?