|
From: | Jonas Åberg |
Subject: | optimize code |
Date: | Mon, 2 Dec 2013 11:28:39 +0000 |
It is a bit of a newbie problem this, but can this be vectorised? In principle I need to do
for i=1:10 vector(i)=rand endfor
I would like to do it by using something that “looks” somewhat like this vector(1:10)=rand Where different random values are assigned to the different positions of the vector.
Of course, the way I wrote it the same random value is assigned to all positions of vector, but I don’t want that…
Is this possible?
/Jonas |
[Prev in Thread] | Current Thread | [Next in Thread] |