[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Octave too slow runnig some instruction
From: |
sd83 |
Subject: |
Re: Octave too slow runnig some instruction |
Date: |
Thu, 24 Jun 2010 03:00:39 -0700 (PDT) |
Oh, I'm sorry. This is my m-file'code:
function h=make_random_direction(n,N,sigma)
x=zeros(N,1);
y=zeros(N,1);
for i=1:N
x(i)=normrnd (0,sigma(i)*sigma(i),1,1);
y(i)=normrnd (0,sigma(i)*sigma(i),1,1);
end
h=zeros(n,2);
t=linspace(0,2*pi,n);
for i=1:n
for j=1:N
h(i,1)=h(i,1)+x(j)*cos(t(i)*j);
h(i,2)=h(i,2)+y(j)*sin(t(i)*j);
end
end
end
I have runned it using
n=N=1000;
sigma(i)=1/i for i=1,...,N.
--
View this message in context:
http://octave.1599824.n4.nabble.com/Octave-too-slow-runnig-some-instruction-tp2266693p2266713.html
Sent from the Octave - General mailing list archive at Nabble.com.