help-octave
[Top][All Lists]
Advanced

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

parcellfun and rand


From: Muhali
Subject: parcellfun and rand
Date: Fri, 3 Sep 2010 21:55:11 -0700 (PDT)

Unlike cellfun, parcellfun appears to re-initialize the rand function in each
call. This is counter-intuitive.

octave:1> disp(parcellfun(1, @(x) rand, cell(1,1), "UniformOutput", false,
"verboselevel", 0))
{
  [1,1] =  0.32068
}
octave:2> disp(parcellfun(1, @(x) rand, cell(1,1), "UniformOutput", false,
"verboselevel", 0))
{
  [1,1] =  0.32068
}
octave:3> disp(cellfun(@(x) rand, cell(1,1), "UniformOutput", false))
{
  [1,1] =  0.32068
}
octave:4> disp(cellfun(@(x) rand, cell(1,1), "UniformOutput", false))
{
  [1,1] =  0.26259
}

-- 
View this message in context: 
http://octave.1599824.n4.nabble.com/parcellfun-and-rand-tp2526487p2526487.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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