How can I generate a pseudo random column vector V
    3 次查看(过去 30 天)
  
       显示 更早的评论
    
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)
0 个评论
回答(1 个)
  Jon
      
 2022-12-5
        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.  
2 个评论
  Jon
      
 2022-12-6
				Glad that helped. If that answered your question please accept the answer so that others who might have a similar problem will know that an answer is available.
另请参阅
类别
				在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

