if-tests being ignored?
Matthew Tylee Atkinson
M.T.Atkinson at lboro.ac.uk
Fri Jan 11 18:29:10 CST 2008
On Sat, 2008-01-05 at 00:10 +0100, Søren Hauberg wrote:
> Hi,
> and welcome to Octave :-) Replies are below...
>
. . .
> function retval = test(x)
> retval = 0 * x;
> retval(x<6) = 3/4 * x(x<6);
> retval(x<3) = 1/4 * x(x<3);
> endfunction
>
> At first, this code might seem a bit odd, but you'll get used to the way
> of thinking, and then you'll love it :-)
Sorry for the delay in replying and thank you very much for your
detailed reply. It has helped considerably!
best regards,
--
Matthew Tylee Atkinson <M.T.Atkinson at lboro.ac.uk>
More information about the Help-octave
mailing list