help-octave
[Top][All Lists]
Advanced

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

Creating a varargin-like object


From: Edward C. Jones
Subject: Creating a varargin-like object
Date: Mon, 20 Feb 2006 00:50:12 -0500
User-agent: Debian Thunderbird 1.0.7 (X11/20051017)

I use the Debian package octive2.1 version 1:2.1.72-10.

Here is an octave interactive session:

octave:1> c = cell(2)
c =

{
  [1,1] = [](0x0)
  [2,1] = [](0x0)
  [1,2] = [](0x0)
  [2,2] = [](0x0)
}

octave:2> c{:}
ans =

(,
  [1] = [](0x0)
  [2] = [](0x0)
  [3] = [](0x0)
  [4] = [](0x0)
,)

What kind of an object is c{:}? Note the curly brackets.

The octave source code is full of stuff like:

function plot (varargin)
  __plt__ ("plot", varargin{:});

Why are the curly brackets used?

Suppose I have a collection of strings 'A', 'B', ... What should XXX be in
the following:
    XXX = ?????
    menu('sometext', XXX)
so that the choices in the menu are 'A', 'B', etc. In other words, how do I
create a varargin-like object from scratch?



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

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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