help-octave
[Top][All Lists]
Advanced

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

Odd plot behavior in functions in Octave 2.9.12


From: Joshua Redstone
Subject: Odd plot behavior in functions in Octave 2.9.12
Date: Wed, 6 Jun 2007 10:34:06 -0700

Hi,
I'm running Octave 2.9.12 on an Ubuntu box.
The follow Octave script:

1;
function [] = dummy()
  x = 0 : 0.1 : 1;
  plot(x, x);
endfunction

dummy();
print("-Pjimmy");
pause;

Displays a plot, but errors in the print command with:

error: octave_char_matrix_str::valid_as_scalar_index(): not implemented
error: near line 8 of file `/tmp/test.m'

If I replace the call to dummy() with the contents of the function, then it works fine.
Also, oddly enough, if I remove the '1;' at the head of the file, I get a wanring that the function name doesn't match the file name,
but the print command succeeds.

Is there any way to call plot() from within a function and print later, as in the above example?
I'd like to do this because in my real application, the plot command is quite complex and I'm using 'hold on' to overlay multiple
plots on a single graph.

Thanks,
Josh


reply via email to

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