discrepancy between 'zeros' and 'eye' in octave-3.0.5

John W. Eaton jwe at octave.org
Thu Jul 9 14:41:57 CDT 2009


On  1-Jul-2009, Sergei Steshenko wrote:

| 'help zeros' among other things says:
| 
| "The arguments are handled the same as the arguments for `eye'."
| 
| In practice:
| 
| "
| octave:39> zeros([0 1 2])
| ans = [](0x1x2)
| octave:40> eye([0 1 2])
| error: eye (A): use eye (size (A)) instead
| ",
| 
| i.e. there is an error message in case of 'eye' and no error message in 
| case 'zeros', so I'd say it's not the same way.

Eye can only create 2-d matrices.  I guess the docstring was not
updated when ones, zeros, etc. were changed so that they can create
N-d arrays.  I checked in the following change.

  http://hg.savannah.gnu.org/hgweb/octave/rev/b317debeb828

jwe



More information about the Bug-octave mailing list