필터 지우기
필터 지우기

linear combination matrix columns

조회 수: 2 (최근 30일)
fede
fede 2015년 9월 22일
답변: Thorsten 2015년 9월 22일
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.

채택된 답변

Thorsten
Thorsten 2015년 9월 22일
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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by