Borrar filtros
Borrar filtros

linear combination matrix columns

2 visualizaciones (últimos 30 días)
fede
fede el 22 de Sept. de 2015
Respondida: Thorsten el 22 de Sept. de 2015
If I have the following matrix
1 5 6
2 7 6
3 2 2
with c1 c2 and c3 the columns I want obtain the following linear combinations c1 c2, c2 c3, c1 c3, and for each couple calculate the covariance.

Respuesta aceptada

Thorsten
Thorsten el 22 de Sept. de 2015
C = [1 5 6; 2 7 6; 3 2 2]';
ind = nchoosek(1:3, 2)
for i = 1:size(ind)
cov(C(:, ind(i,:)))
end

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices 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