help-octave
[Top][All Lists]
Advanced

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

Re: Load data with script


From: John W. Eaton
Subject: Re: Load data with script
Date: Wed, 16 Sep 2009 13:01:54 -0400

On 16-Sep-2009, Steffen Titze wrote:

| it is a script to load a data file.
| The script is only a m file. At the time no function or call to a 
| function is in the m file, i open only the data file and transfer the 
| value martix to x. I comment the other things out, because at the 
| beginning i thought their is a problem with the other code. But with 
| verion 3.0.3 i hadn't any problems with the code.
| 
| To call the m file i go to the folder of the m file in octave and start 
| with "script.m"
| The m file and die Data.txt are in the same folder.

So the file is named script.m and you are typing script.m at the
Octave prompt?  Try typing script (without the .m extension).

If that is the problem, then did you never see

  error: can't perform indexing operations for <unknown type> type

when doing this with Octave 3.0.x?

This used to happen because an expression like

  s.e

is an expression to access the structure element E from the structure
S.  When you type

  script.m

Octave evaluated "script" by calling the script then attempting to
index the result with ".m".  So the script was being evaluated, but
since scripts don't return values, the indexing operation failed.

Now, Octave recognizes in advance that "script" is a script, and since
it can't produce a value for indexing, it gives you the error
immediately instead of after evaluating the script.

jwe


reply via email to

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