help-octave
[Top][All Lists]
Advanced

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

help on cellfun


From: Eric Chassande-Mottin
Subject: help on cellfun
Date: Thu, 24 Feb 2011 11:41:16 -0800 (PST)


hi,

I have a problem with cellfun. I don't understand the results I get from the
following experience

octave3.2:3> a={1,2,3},b={"A","B","C"}
a =

{
  [1,1] =  1
  [1,2] =  2
  [1,3] =  3
}

b =

{
  [1,1] = A
  [1,2] = B
  [1,3] = C
}

octave3.2:4> cellfun(@(x,y){x,y},a,b,"UniformOutput","false")
error: octave_base_value::bool_value(): wrong type argument `string'
error: cellfun: too many output arguments

while I would expect the result to be

octave3.2:7> {{a{1},b{1}},{a{2},b{2}},{a{3},b{3}}}
ans =

{
  [1,1] =

  {
    [1,1] =  1
    [1,2] = A
  }

  [1,2] =

  {
    [1,1] =  2
    [1,2] = B
  }

  [1,3] =

  {
    [1,1] =  3
    [1,2] = C
  }

}

can someone please help ?

eric
-- 
View this message in context: 
http://octave.1599824.n4.nabble.com/help-on-cellfun-tp3323295p3323295.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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