Borrar filtros
Borrar filtros

Generate a matrix from linearly spaced vector

1 visualización (últimos 30 días)
Kash022
Kash022 el 8 de Mayo de 2017
Respondida: KSSV el 8 de Mayo de 2017
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

Respuesta aceptada

KSSV
KSSV el 8 de Mayo de 2017
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

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by