Re: documentation specification for Documentation Center-iteration
- To: mathgroup at smc.vnet.net
- Subject: [mg90078] Re: documentation specification for Documentation Center-iteration
- From: Francisco Gutierrez <fgutiers2002 at yahoo.com>
- Date: Sat, 28 Jun 2008 05:51:53 -0400 (EDT)
- Reply-to: fgutiers2002 at yahoo.com
It was so easy Jean Marc...Thanks1 Thanks also to Daniel for his excellent and clear explanation about how to combine Dos and Folds
Francisco
--- On Thu, 6/26/08, Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com> wrote:
From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
Subject: [mg90078] Re: documentation specification for Documentation Center
To: fgutiers2002 at yahoo.com, mathgroup at smc.vnet.net
Date: Thursday, June 26, 2008, 9:55 AM
Francisco Gutierrez wrote:
> I have problems creating packages. See for example the following very
simple package:
> BeginPackage["fuss`Func`"]
>
> crisclas::usage="Inputs are a set of training
> vectors, a first guess vector, a zero, and a learning rate ";
>
> Begin["`Private`"]
>
> crisclas[trainingvec_,guess_,cero_,ritmo_]:=Module[{guess1=guess,\
> hacerlalista={}},If[trainingvec[[i]].guess-cero>0, guess, \
======================!!!!!!!!!!!!^^^^
ERROR: the index 'i' has been neither *declared* nor *defined* at this
stage. At "best", without the package context, the function is going
to
use whatever value a global called 'i', if any, holds, which is
certainly not what you want. An easy fix is to define the index 'i' in
the list of local variables (i.e. first argument of Module[]):
Module[{guess1 = guess, hacerlalista = {}, i = 1},
<snip>
Regards,
-- Jean-Marc