[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing information returned from 'dir'

From: John W. Eaton
Subject: Re: Accessing information returned from 'dir'
Date: Wed, 6 Oct 2004 12:38:43 -0400

On  6-Oct-2004, Etienne Grossmann <address@hidden> wrote:

|   But, it the following normal? Or is my mind trapped in the good ol'
| days of lists?
|     octave:3> foo = cell(3,4); bar = foo{:,1}; typeinfo (foo)
|     ans = cell
|     octave:4> typeinfo (bar)
|     *** typeinfo:
|     - Built-in Function:  typeinfo (EXPR)
|     Return the type of the expression EXPR, as a string.  If EXPR  is
|     omitted, return an array of strings containing all the currently
|     installed data types.

The expression foo{:,1} returns a comma-separated list (in Matlab, you
would not even be able to perform the assignment to the variable bar
-- should Octave also make this an error?).  When you pass a
comma-separated list to a function, you are passing each element as a
separate argument.  The typeinfo function expects a single argument,
but you are passing three.


Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]