|
From: | Nicholas Jankowski |
Subject: | Re: unexpected syntax error when defining a global variable? |
Date: | Tue, 21 Apr 2015 13:19:04 -0400 |
global
statement..." as the only limitation. I guess it's related.I don't think you can declare a global and use indexing on it at the same time. Try in two steps:Le 21/04/2015 18:43, Nicholas Jankowski a écrit :
Nick J.Is that supposed to happen? I didn't think a global designation was supposed to change anything with syntax. bug?if the characters spacing is messed up, it's pointing to the (simple example:^
-------------------
>> segments = 5;
>> p_i(1:segments+1)= 0
p_i =
0 0 0 0 0 0
BUT
>> segments = 5;
>> global p_i(1:segments+1)= 0
parse error:
syntax error
>>> global p_i(1:segments+1)= 0
-----------------------------------
global p_i
p_i(1:segments+1)= 0;
or
global p_i
p_i = zeros (1, segments + 1);
https://www.gnu.org/software/octave/doc/interpreter/Global-Variables.html#Global-Variables
_______________________________________________
Help-octave mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-octave
[Prev in Thread] | Current Thread | [Next in Thread] |