Tue 31 Jan 2017 12:06:23 PM UTC, comment #7:
In Octave, we don't error on nargout being too large, we just let it go and then you get a generic warning about undefined outputs.
If you call error before print_usage, the print_usage function will never be executed.
Instead of checking nargin, you could use a default input value.
The whole function could then be
Also, @var{x} will capitalize its argument when generating Info output, but will not when generating TeX output (it uses a slanted font instead), so you should write @var{x}, not @var{X}.
Could someone make those changes and also create a proper changeset that adds this file to some directory (which one? Octave doesn't currently have a demos directory), updates the corresponding module.mk file, and adds the function to the manual?
I suppose it could be included along with sombrero and peaks. Maybe make it plot the function if nargout is 0?
And, for completeness, maybe add a test or two just so it doesn't add to the count of functions without tests?
Thanks.
|