From help-octave-request at bevo dot che dot wisc dot edu Thu Nov 5 23:23:34 1998 Subject: Empty Matrix DLD question From: "John W. Eaton" To: Andy+Alison Adler Cc: help-octave at bevo dot che dot wisc dot edu Date: Thu, 5 Nov 1998 23:23:09 -0600 (CST) On 5-Nov-1998, Andy+Alison Adler wrote: | I'd like to return an empty matrix from | an *oct file. | | Initially I hoped that when cx==0 | | X["ridx"]= ridxX.extract( 0, cx-1); | | would return an empty matrix. | No luck. x.ridx is a two element column vector. | | Next, I tried | | if ( cx > 0 ) { | X["ridx"]= ridxX.extract( 0, cx-1); | } else { | ColumnVector nullvec(0); | X["ridx"]= nullvec; | } | | But this segfaults octave. Hmm. I can't reproduce the problem given just this information. Can you please send a copmlete bug report to bug-octave that includes a copmlete test case that demonstrates the bug? | I couldn't find any examples of how to do this | in the source. | | Is there an approved way to create empty matrices? Try X["ridx"] = Matrix (); Thanks, jwe