[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #45496] "error: no default value for argument"
From: |
Nick Jankowski |
Subject: |
[Octave-bug-tracker] [bug #45496] "error: no default value for argument" fails to give function/line number/etc |
Date: |
Thu, 09 Jul 2015 01:13:22 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0 |
Follow-up Comment #2, bug #45496 (project octave):
> what is that supposed to do?
I didn't realize Octave supported this, but apparently a : as a function input
is a placeholder for whatever default value is specified in the function
definition.
For me, it was a typo. Since the error wasn't reporting tho stack trace, it
took me a bit to find the source of the error.
It was buried in a function I wrote to do a fast matrix multiply between
arrays of 2x2 matrices. (attached)
I had misordered by inputs to the calling function, so instead of getting two
arrays to multiply, it was passed an array and a function handle instead.
You can see in the attached file, it rolls out the matrix multiply, calling
each element by A(1,1,:), etc. So, since it saw A as a function handle, it
got rightly confused.
legitimate error. no stack trace. :)
(file #34399)
_______________________________________________________
Additional Item Attachment:
File name: twobytwoarraymult.m Size:0 KB
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?45496>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/