필터 지우기
필터 지우기

Generate a matrix from linearly spaced vector

조회 수: 1 (최근 30일)
Kash022
Kash022 2017년 5월 8일
답변: KSSV 2017년 5월 8일
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

채택된 답변

KSSV
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개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by