[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: assign file load to var in octave 3.2
From: |
David Grundberg |
Subject: |
Re: assign file load to var in octave 3.2 |
Date: |
Thu, 25 Mar 2010 13:30:28 +0100 |
User-agent: |
Thunderbird 2.0.0.23 (X11/20090812) |
Nuno Lopes wrote:
Hello all,
I have a generated set of files with matrixes (from benchmark times) that I
want to load into a variable in octave.
In the script I was using to crunch the numbers (seems to still work in octave
3.0) I used the following instruction:
var = load -text -;
But in octave 3.2 (which is the version I have installed in the machine I'm
working) I get a parse error. My guess is that the syntax has changed somehow
but I cannot find any info on the web. Can somebody give me some pointers on
how to fix this?
Thanks a lot
--
Nuno Lopes
From the NEWS file:
** Parsing of Command-style Functions.
Octave now parses command-style functions without needing to first
declare them with "mark_as_command". The rules for recognizing a
command-style function calls are
* A command must appear as the first word in a statement,
followed by a space.
* The first character after the space must not be '=' or '('
* The next token after the space must not look like a binary
operator.
These rules should be mostly compatible with the way Matlab parses
command-style function calls and allow users to define commands in
.m files without having to mark them as commands.
Note that previous versions of Octave allowed expressions like
x = load -text foo.dat
but an expression like this will now generate a parse error. In
order to assign the value returned by a function to a variable,
you must use the normal function call syntax:
x = load ("-text", "foo.dat");
hth,
David