How can I generate a pseudo random column vector V
Show older comments
for N = [1 2 5 10.^[ 1 : 5 ] ]
V = rand( N, 1 ) ; % I'm not sure if it should look like this
end
I have this cycle, how can I generate a pseudo random column vector V of varying length N (using this cycle)
Answers (1)
Jon
on 5 Dec 2022
0 votes
Yes this will make a random column vector of length N at each iteration.
The values will be uniformly distributed between 0 and 1. If you want them normally distributed use randn.
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!