|
| From: | Garrett |
| Subject: | [Octave-bug-tracker] [bug #35482] var(varargin{end})=1 gives an error |
| Date: | Wed, 08 Feb 2012 15:52:36 +0000 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20100101 Firefox/10.0 |
URL:
<http://savannah.gnu.org/bugs/?35482>
Summary: var(varargin{end})=1 gives an error
Project: GNU Octave
Submitted by: g2e
Submitted on: Wed 08 Feb 2012 03:52:35 PM GMT
Category: Interpreter
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Incorrect Result
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 3.6.0
Operating System: GNU/Linux
_______________________________________________________
Details:
Make a simple function:
function [x]=simple(varargin)
x(varargin{end})=1;
endfunction
and run it:
octave:1> simple(3)
error: invalid dimension inquiry of a non-existent value
error: invalid empty index list
error: called from:
error: /opt/seizmo/seizmo/simple.m at line 2, column 17
If i change the simple function to not use the 'end' keyword then simple(3)
works:
function [x]=simple(varargin)
x(varargin{1})=1;
endfunction
octave:1> simple(3)
ans =
0 0 1
It looks like Octave is trying to interpret the 'end' keyword in the context
of the x variable rather than varargin.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?35482>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
| [Prev in Thread] | Current Thread | [Next in Thread] |