help-octave
[Top][All Lists]
Advanced

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

What does "ans is no longer a built-in variable" mean?


From: Judd Storrs
Subject: What does "ans is no longer a built-in variable" mean?
Date: Tue, 23 Jun 2009 15:45:07 -0400

I'm porting some matlab code to octave and I've run into a warning that can be reproduced thusly

octave:1> ans = 5
warning: ans is no longer a built-in variable; please read the NEWS file or type `news' for details

I'm having trouble understand this warning message. I looked through the NEWS{,.1,.2,.3} files and I couldn't identify the relevant section. My first thought was that octave was warning me that octave doesn't assign the result of the last evaluation to "ans". But that doesn't seem to be the correct interpretation:

octave:1> sin(5)
ans = -0.95892
octave:2> ans
ans = -0.95892

...besides the error occurs when you assign a value to a variable called "ans", not when you try to use it. After thinking about the message obliquely for a bit, I decided that maybe octave was trying to warn me that my assigned a value to "ans" would override the automatic value for the rest of the scope or session. But that also doesn't seem to be the correct interpretation either:

octave:1> ans = 5
warning: ans is no longer a built-in variable; please read the NEWS file or type `news' for details
ans =  5
octave:2> sin(5)
ans = -0.95892
octave:3> ans
ans = -0.95892
octave:4>

Does anyone know what this warning is about?

Thanks,

--judd


reply via email to

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