if-tests being ignored?

Matthew Tylee Atkinson M.T.Atkinson at lboro.ac.uk
Fri Jan 4 16:43:08 CST 2008


I'm a new user to Octave, so am sure that I'm missing something very
obvious but I really can't figure out what it is.

There are two problems I'm having (quite possibly related).  I would be
grateful for any advice you may have on how to fix them.  I have
attached a .m file that demonstrates them.  I'm running version 2.9.19.

1. When I run ``octave confused.m'' on the command-line, the plot
instruction seems to be ignored (fair enough, it could require to be run
in interactive mode, but when I use -i, it still is ignored).

2. When I source the file from within Octave, it loads and plots the
graph but the graph drawn is not as expected -- given the code, the
gradient of the graph should change twice at certain points along the x
axis.  It seems the if tests always evaluate to false.  When I run
``test(n)'' at the prompt, however, the correct values are returned from
the function.

Thanks for your time,

best regards,


-- 
Matthew Tylee Atkinson <M.T.Atkinson at lboro.ac.uk>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: confused.m
Type: text/x-objcsrc
Size: 274 bytes
Desc: not available
Url : https://www.cae.wisc.edu/pipermail/help-octave/attachments/20080104/cb1c4532/attachment.bin 


More information about the Help-octave mailing list