[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
misbehavior in Octave 2.9.4 for OS/2
From: |
Dushan Mitrovich |
Subject: |
misbehavior in Octave 2.9.4 for OS/2 |
Date: |
Fri, 16 Jun 2006 08:37:58 -0700 |
User-agent: |
VSoup v1.2.9.48Beta [OS/2] |
I'm new to Octave, so my apologies if some of these questions are naive.
Yesterday I downloaded version 2.9.4 compiled for OS/2 by Dmitry Froloff
<http://froloff.homeip.net/zips/octave-2.9.4-bin.zip>, and installed it.
My OS is eComStation 1.2, the current version of OS/2.
In trying out Octave to learn it, I ran into some behavior that I don't
understand, and I don't know whether it's due to my ignorance, a bad set-
ting, or a problem with the compilation that ought to be brought to Mr.
Froloff's attention. I would appreciate all guidance and suggestions.
As installed, Octave uses E.EXE as the editor and LESS.EXE as the pager.
Here is the behavior I encountered:
# If I define a simple function from the command line, it works fine;
but if I then edit the function using 'edit_history n1 n2' (where n1
and n2 are the appropriate history line numbers for the function),
there is no result even tho the function is unchanged (I had added a
space, then saved the function before exiting the editor). In other
words, I just get the standard Octave prompt back.
# A more complicated function 'sinc(x) = sin(x) / x' that I would like
to have work for vector x as well as scalar, and for '0' argument,
works if defined from the command line but not after it is edited.
Here is the function definition:
function sinc (x)
if (1-isvector(x))
if (x==0)
sinc = 1
else
sinc = sin(x) / x
endif
return
else
nc = length(x);
sinc = linspace(1,nc,nc);
for i=1:nc
if (x(i)==0)
sinc(i) = 1
else
sinc(i) = sin(x(i)) / x(i)
endif
endfor
return
endif
endfunction
When defined from the command line for a vector 'a = 0:pi/10:2*pi' it
produces 21 sets of vectors, each with an additional element computed,
looking something like this, but spread out over many more lines :
sinc = 1.0000 2.0000 3.0000 4.0000 5.0000 ... 21.0000
sinc = 1.0000 0.9836 3.0000 4.0000 5.0000 ... 21.0000
sinc = 1.0000 0.9836 0.9355 4.0000 5.0000 ... 21.0000
sinc = 1.0000 0.9836 0.9355 0.8584 5.0000 ... 21.0000
sinc = 1.0000 0.9836 0.9355 0.8584 0.7568 ... 21.0000
. . .
sinc = 1.0000 0.9836 0.9355 0.8584 0.7568 ... ~ 0.
Is this normal, or a consequence of my function definition?
Originally I had used 'is_vector' instead of 'isvector' in the defini-
tion. When I tried to compute 'sinc(1)' I got the error messages:
error: no such file, 'I:/octave/I:\octave/scripts/deprecated/is_vector.m'
error: 'is_vector' undefined near line 2 column 12
error: evaluating binary operator `-' near line 2, column 11
error: if: error evaluating conditional expression
error: evaluating if command near line 2, column 6
error: called from `sinc'
So I edited the function definition to change 'is_vector' to 'isvector'
and discovered that asking for 'sinc(1)' kept producing the exact same
message. Only after I quit Octave, then restarted it, did it recog-
nize the change and produce a different message.
I suspect part of the problem here is that there's an inconsistency
between Octave's path references using a forward slash '/' and OS/2's
using a backward slash '\', but I'm not sure how to resolve that.
# If I type 'help function', I get a short explanation, as expected.
But if I type 'help history' or 'help edit_history' I get:
SYS0003: The system cannot find the path specified
< a one-line definition >
warning: help: Texinfo formatting filter exiting abnormally
warning: help: raw Texinfo source of help text follows...
except that for 'help edit_history' there are an additional two lines:
WARNING: terminal is not fully functional:
- (press RETURN)
This warning also appears when I ask for 'history 100'.
At least some of these problems seem to be related to an incomplete trans-
lation from linux-speak to OS/2-speak, so should probably be refered to
Mr. Froloff. But any insight from this group would be appreciated.
Thanks, and sorry for the length of the message.
- Dushan Mitrovich
- misbehavior in Octave 2.9.4 for OS/2,
Dushan Mitrovich <=
misbehavior in Octave 2.9.4 for OS/2, John W. Eaton, 2006/06/16
Re: misbehavior in Octave 2.9.4 for OS/2, Steven Levine, 2006/06/16