help-octave
[Top][All Lists]
Advanced

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

Re: [newbie] how to avoid a for-loop


From: Pantxo
Subject: Re: [newbie] how to avoid a for-loop
Date: Thu, 18 Dec 2014 09:23:05 -0800 (PST)

Hi,

Does the following help ?

function [result] = calp(m)
  tmp = arrayfun (@(x) nchoosek (2*m-x, x), 0:m,
                         "uniformoutput", false);
  result = cell2mat (tmp);
endfunction

Pantxo



--
View this message in context: 
http://octave.1599824.n4.nabble.com/newbie-how-to-avoid-a-for-loop-tp4667872p4667875.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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