[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help on error: can't perform indexing

From: Maynard Wright
Subject: Re: Help on error: can't perform indexing
Date: Thu, 15 Feb 2007 07:18:14 -0800
User-agent: KMail/1.9.1

This occurs with several versions of Octave running under RH 8, Kubuntu 
Dapper, and Windows XP.  It's not code dependent as I can cause the error 
message to occur even with an empty script file.

I'm happy to know that it's not really a problem because the script files 
involved have been producing correct answers.  I guess I'm used to ignoring 
the returns from C functions without any messages unless I have the warning 
level cranked up.

Thanks to all of you,



On Wednesday 14 February 2007 21:14, John W. Eaton wrote:
> On 14-Feb-2007, Muthiah Annamalai wrote:
> | On Wed, 2007-02-14 at 11:42 -0800, Maynard Wright wrote:
> | > , the Octave script file runs correctly and yields the right answer
> | > and the message is then displayed.  This occurs only when a script
> | > file with
> | > an extension ".m" is executed from within Octave.
> |
> | O.K Can you please post what script you got, and what version of Octave
> | you are running? Maybe you should post a bug-report on the address@hidden
> | list if possible.
> |
> | >   When there is no extension
> | > or when the extension is other than ".m," the file cannot be executed
> | > without
> | > using source "filename."  When source is used to execute the file, I
> | > don't
> | > see the error message, even when the filename has a ".m" extension.
> |
> | That is correct behavior. See 'help source'
> |
> | > When the ".m" file is executed as a script from the Linux command
> | > line, it
> | > works properly and the error message does not occur.
> | >
> | > I used addpath() to add the path containing the file without effect.
> | > The path
> | > was already in my bash shell PATH va
> |
> | I cant say anything. You need to be more specific, please.
> I think you already diagnosed the problem in an earlier message:
>   OTOH, Octave tries to decode prog.m as a structure prog, with field m
>   which is why it reports such an error I believe.
> Maybe the following will help.
> To execute a function or script, you use the name of the function or
> script file without the ".m" extension.  To call a function, you don't
> need to write "foo ()" (though I generally prefer this syntax).  A
> simple "foo" will work if the function takes no arguments.  So if you
> write
>   prog.m
> then Octave calls the function "prog", then attempts to perform
> structure indexing (the .m part of the expression) on the value
> returned from "prog".  If the function doesn't return a value, then
> the structure indexing fails with the message:
>   error: can't perform indexing operations for <unknown type> type
> This is not a bug in Octave.
> jwe

reply via email to

[Prev in Thread] Current Thread [Next in Thread]