help-octave
[Top][All Lists]
Advanced

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

initialising a cell array using an array


From: Francesco Potorti`
Subject: initialising a cell array using an array
Date: Tue, 21 Feb 2006 14:15:40 +0100

I have this code:

  speeds=[1, 2, 5.5, 11];       # Available speeds

    choices=cell();             # create a menu of available speeds
    for i = 1:length(speeds)
      choices{i} = sprintf("%g Mb/s", speeds(i));
    endfor
    sel = menu("Nominal speeds:", choices{:});

In order to create the argument list for menu, I use a cell array.  But
initialising the cell array needs a loop.  Can I vectorise the loop?

-- 
Francesco Potortì (ricercatore)        Voice: +39 050 315 3058 (op.2111)
ISTI - Area della ricerca CNR          Fax:   +39 050 313 8091
via G. Moruzzi 1, I-56124 Pisa         Email: address@hidden
Web: http://fly.isti.cnr.it/           Key:   fly.isti.cnr.it/public.key



-------------------------------------------------------------
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]