help-octave
[Top][All Lists]
Advanced

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

global variables


From: Luis A. Montes
Subject: global variables
Date: Mon, 09 Feb 2009 08:19:11 -0800

I'm having a strange problem with global variables. Searched the list
but nothing seems to show up. Mind you that I'm a rather sporadic user
of octave (or Matlab, for that matter), I was just trying to import some
Matlab scripts to Octave running under Linux (Ubuntu Hardy) when I got
the following:

octave script.m
GNU Octave, version 3.0.0
Copyright (C) 2007 John W. Eaton and others.
[...]

parse error near line 3 of file p10_1.m

  syntax error

>>> global cost hr hx grid N N_2;
                                       ^

If I split the global declaration at the caret position so that I have:

global cost hr hx grid;
global N N_2;

Then the syntax error goes away. I also renamed N variables to a longer
name thinking that they could be clashing with other "default" global
variables, but no dice.

I don't understand the problem or the solution, so I'm wondering if
there is a less obvious problem with the second form that will cause the
script to fail in more subtle ways.

Thanks



reply via email to

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