help-octave
[Top][All Lists]
Advanced

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

Comments in data -- bug??


From: Ted Harding
Subject: Comments in data -- bug??
Date: Wed, 23 Sep 1998 15:59:27 +0100 (BST)

I want to put comments on the lines of data in an m-file defining
matrices, e.g.

data_1994 = [
10 25 % 20 Apr 1994
 3 14
13 39
12 21
24 42
 6 12
 2 15
 3  4
 8 16
 5 12
29 56 % 30 Apr 1994
];

However, on being run, this gives me:

parse error near line 3 of file temp.m

>>>  3 14
    ^

parse error near line 4 of file temp.m

>>> 13 39
         ^

and so on. Now I change it so that there are no spaces at the beginning
of the line:

data_1994 = [
10 25 % 20 Apr 1994
03 14
13 39
12 21
24 42
06 12
02 15
03  4
08 16
05 12
29 56 % 30 Apr 1994
];

and it works perfectly (of course, without the comments it also works,
spaces or no spaces). This change of behaviour, depending on whether
there is a space or not, strikes me as anomalous: the Manual says "The
Octave interpreter ignores the rest of the line following a sharp sign or
a percent symbol", which is what happens in the second case and
presumably should also happen in the first.

Bug?? (Octave, version 2.0.13 (i586-pc-linux-gnulibc1), compiled by me).


Best wishes,
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Date: 23-Sep-98                                       Time: 15:59:27
--------------------------------------------------------------------



reply via email to

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