Generate a matrix from linearly spaced vector
    3 次查看(过去 30 天)
  
       显示 更早的评论
    
Hello,
I have the following line of code which generates a linearly spaced vector. How do I change it to a matrix of size m-by-n so that I can perform cov(log_sigma)? (covariance of noise matrix)
log_sigma=linspace(-2,2,30);
Thanks
0 个评论
采纳的回答
  KSSV
      
      
 2017-5-8
        doc reshape
N = 30 ;
log_sigma=linspace(-2,2,N);
m = 5 ; n = 6 ;
if m*n ~=N
  disp('you cannot reshape')
 break
else
  iwant = reshape(log_sigma,m,n)
end
0 个评论
更多回答(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!

