add random numbers and generate a matrix
1 次查看(过去 30 天)
显示 更早的评论
hi! i have an array A of size (75*1). i want to generate from this array a big Matrix of size(75*75* 30) i did it in this manner
M_m=bsxfun(@plus,A,10*rand([1 3],75,30))
my problem i want to mhave not only plus but also minus. something lik this:
M_m=bsxfun(@plus,A,10*rand([1 3],75,30)*sign(randn(75,30)))
could someone help me?
2 个评论
Image Analyst
2012-12-11
75 by 75 by 30 is far from big. But anyway, it seems like you want to add noise to some 3D array but I'm not sure what pattern you're going to use to build that 3D array from the column vector that is A. Please clarify.
回答(0 个)
另请参阅
类别
在 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!