help-octave
[Top][All Lists]
Advanced

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

Cannot clear a global variable from inside a function


From: oxyopes
Subject: Cannot clear a global variable from inside a function
Date: Mon, 14 Jan 2008 18:54:17 +0100

Hi friends, look that:

global x=[1 2 3];

function mmm
     global x
     printf("the value of x is %d\n", x)
     clear x; global x
endfunction

mmm
clear x; global x   % clears x outside mmm
x(1)=2;
mmm


The second run of mmm should show only x(1),
since the others were cleared. But no, they aren't cleared.
The manual doesnt mention that. Any tip?

Thanks in advance ...


reply via email to

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