Octave objects

John W. Eaton jwe at bevo.che.wisc.edu
Mon Nov 10 17:31:51 CST 2008


On  6-Nov-2008, Jeremy Kepner wrote:

| Hi John,
|    I am testing version 3.1.51 octave.
| When I run  the attached program I get the
| following error having to do with objects
| in octave:
| 
|  >> pStream
| warning: version: ignoring extra arguments
| error: `argn' undefined near line 0 column 10
| error: evaluating argument list element number 1
| error: evaluating assignment expression near line 35, column 5
| error: called from `inputname' in file `/usr/local/octave-3.1.51/ 
| share/octave/3.1.51/m/miscellaneous/inputname.m'
| error: evaluating argument list element number 2
| error: called from `subsasgn' in file `/home/gridsan/kepner/pMatlab/ 
| src/@dmat/subsasgn.m'
| error: assignment failed, or no method for `class = matrix'
| error: evaluating assignment expression near line 0, column 9
| error: evaluating if command near line 84, column 1
| error: called from `zeros' in file `/home/gridsan/kepner/pMatlab/src/ 
| @map/zeros.m'
| error: evaluating argument list element number 1
| error: evaluating binary operator `+' near line 68, column 39
| error: evaluating assignment expression near line 68, column 10
| error: called from `pStream' in file `/home/gridsan/kepner/ 
| KepnerBookCode/Examples/Stream/pStream.m'

I don't see "inputname" anywhere in the code you sent, but as I recall
from the from testing pMatlab you need the following change:

  * assignin.diff: There is a bug in Octave that prevents the

      assignin('caller', inputname(1), []);

    statement from working.  Since this call to assignin is an attempt
    at optimizing memory usage and does not affect the results, it
    seems simplest to comment this line out.

diff -ru pMatlab.orig/src/@dmat/subsasgn.m pMatlab/src/@dmat/subsasgn.m
--- pMatlab.orig/src/@dmat/subsasgn.m	2005-03-07 15:07:08.000000000 -0500
+++ pMatlab/src/@dmat/subsasgn.m	2008-07-22 11:52:40.000000000 -0400
@@ -12,7 +12,7 @@
 
 % Instead of creating a copy of a, write directly to the memory
 % allocated for a in the caller's workspace
-assignin('caller', inputname(1), []);
+%assignin('caller', inputname(1), []);
 
 if length(s)==1 %subscripting level 
     if s.type == '()' %subscripting type -> parenthesis



jwe


More information about the Bug-octave mailing list