indexing

John W. Eaton jwe at octave.org
Fri Mar 6 12:57:59 CST 2009


On  6-Mar-2009, asha g wrote:

| The error message is related to the for loop.
| for iter =1:niter ( line -80)
| 
| end (line -150)
| 
| error: can't perform indexing operations for <unknown type> type
| error: evaluating for command near line 80, column 1
| error: near line 150 of file `/home/proj/08/cesasha/cabunbact2octester/cabunba
| 
| Sorry for not making this clear. 

You still haven't made it clear.  It would be good if you provided
some context, not just two isolated lines that don't even include an
indexing operation.

Can you debug problems without seeing the code that fails?  Do you
think we can?

Anyway, this kind of error typically happens when you try to call a
script as if it were a function.

The current development version of Octave produces better error
messages.  For example:

  octave:1> fooscript ()
  error: invalid use of script in index expression
  octave:1> fooscript {}
  error: invalid use of script in index expression
  octave:1> fooscript.m 
  error: invalid call to script
  octave:1> 


jwe


More information about the Help-octave mailing list