![]() | 1 | initial version |
This returns such a random vector of a given size. However, note that its elements belong to the semi-open interval [0 1)⊂R, not the closed interval [0 1]⊂R :
sage: def randvect(size=4):return vector([random() for t in range(size)])
sage: randvect(3)
(0.8688082291795581, 0.28209569121849476, 0.3112164215493163)
HTH,