bugGNU Octave - Bugs: bug #34006, inadequate/recursice description...

 
 

bug #34006: inadequate/recursice description of 'length' function

Submitter:  Sergei Steshenko <sergstesh>
Submitted:  Sat 13 Aug 2011 01:49:11 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Documentation
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 3.4.2 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 23 Aug 2011 12:36:46 AM UTC, comment #2: 

It seems to me that "length" is adequately defined in the second sentence of the doc string, even to the point of explaining why the definition is so strange, so I'm closing this report.

John W. Eaton <jwe>
Group administrator
Sat 13 Aug 2011 01:54:22 PM UTC, comment #1: 

Also, I am not sure whether definition of object in the context of this function can be easily found.

If it can't be easily found, it should better be given in the documentation of this function.

Sergei Steshenko <sergstesh>
Sat 13 Aug 2011 01:49:11 PM UTC, original submission:  

This is what I see:


octave:14> help length
`length' is a built-in function

 -- Built-in Function:  length (A)
     Return the "length" of the object A.  For matrix objects, the
     length is the number of rows or columns, whichever is greater (this
     odd definition is used for compatibility with MATLAB).


Additional help for built-in functions and operators is
available in the on-line version of the manual.  Use the command
`doc <topic>' to search the manual index.

Help and information about Octave is also available on the WWW
at http://www.octave.org and via the help@octave.org
mailing list.
octave:15>


, i.e. length is explained through '"length"'.

Another experiment:


octave:15> length("abcde")
ans =  5

.

So, for a string 'length' returns number of characters ?

One more experiment:


octave:16> foo = {"a", "bcdef"}
foo =
{
  [1,1] = a
  [1,2] = bcdef
}
octave:17> length(foo)
ans =  2


- so, for a cell array number of elements is returned ?

All these aspects need to be clarified in documentation.


Sergei Steshenko <sergstesh>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by sergstesh (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-08-23 jwe StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code