On 14 February 2012 10:55, Jordi Gutiérrez Hermoso <jord...@octave.org> wrote:
> On 14 February 2012 10:35, Dr. Alexander Klein
> <alexander.kl...@math.uni-giessen.de> wrote:
>> >> accumulating results of repeated function evaluations (inject_into),
>> >
>> > accumarray?
>
>> Will this do something like
>
>> inject_into (@(x, y){x{:},rand(y)},num2cell(1:10),{})
>
> No, I suppose I misunderstood what you meant with "accumulate". But I
> don't find this function call more convenient than
>
>    cellfun(@(x) rand(x), num2cell(1:10), "unif", 0);

I feel a little silly. That's a completely gratuitous anonymous
function. This will do just as well:

     cellfun(@rand, num2cell(1:10), "unif", 0);

- Jordi G. H.

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to