|
From: | Nicholas Jankowski |
Subject: | Re: Vectorization of a random function |
Date: | Wed, 27 Jan 2016 11:03:59 -0500 |
Hi!
I'm trying to vectorize the following code:
g=zeros(ensayos,1);
for i=1:ensayos
g(i) = TiempoMuerte_Cte(N,c);
endfor
Where TiempoMuerte_Cte(N,c) is a function that does not give always the same
result, so I must run this function "ensayos" times: I've tried to write
g=zeros(ensayos,1);
g(:,1)= TiempoMuerte_Cte(N,c);
but it just computes the function once, and then repeats the value in every
coordinate of "g"
[Prev in Thread] | Current Thread | [Next in Thread] |