help-octave
[Top][All Lists]
Advanced

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

`clear variable` does not work ?


From: oxy
Subject: `clear variable` does not work ?
Date: Wed, 30 Jan 2008 13:44:52 +0100

Hi friends,
i cannot clear a global variable with `clear` as in the example bellow:

%------------ start octave code -------------------
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
%----------- end octave code -----------------

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 ...

PS: i posted this question few weeks ago.
It is normally accepted to repeat a question once :-)


reply via email to

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