octave-maintainers
[Top][All Lists]
Advanced

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

returning a cell array in a octave_value_list ?


From: CdeMills
Subject: returning a cell array in a octave_value_list ?
Date: Fri, 23 Mar 2012 02:43:22 -0700 (PDT)

I tried to find inspiration in strfind.cc.

- the output argument is defined as octave_value retval;
if the first arg is a string, the code is
  retval = octave_value (Array<octave_idx_type>)
if the first arg is a cell array, a new variable retc is defined as a Cell
with the same size as this arg
then it iterate as
     retc(i) = octave_value  (Array<octave_idx_type>)
and finally 
    retval = retc;

So the output is polymorphic: either an array of indexes, either a cell
array of array of indexes

I would like to do the same in sscanf, but its output is an
octave_value_list. I tried using the same mechanism, but I always get back
the scan of the first cell. Any idea ?

Pascal

--
View this message in context: 
http://octave.1599824.n4.nabble.com/returning-a-cell-array-in-a-octave-value-list-tp4498286p4498286.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.


reply via email to

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