[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
misbehavior in Octave 2.9.4 for OS/2
From: |
John W. Eaton |
Subject: |
misbehavior in Octave 2.9.4 for OS/2 |
Date: |
Fri, 16 Jun 2006 13:31:58 -0400 |
On 16-Jun-2006, Dushan Mitrovich wrote:
| # 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:
Octave already has a sinc function, but it computes sin(pi*x)/(pi*x).
It works for scalars and vectors:
function result = sinc (x)
result = ones (size (x));
i = (x != 0);
if (any (i(:)))
t = pi * x(i);
result(i) = sin (t) ./ t;
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,
You have some lines that don't end in semicolons.
jwe
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