필터 지우기
필터 지우기

Cov variance function - how to reduce size of matrix

조회 수: 1 (최근 30일)
scientist121
scientist121 2021년 12월 2일
댓글: Jan 2021년 12월 3일
Hi,
does anyone know how to go from a 5x25 matrix to a 5x10 matrix using the covariance cov function? Like how do you code this on matlab?
TIA
  댓글 수: 3
scientist121
scientist121 2021년 12월 2일
Okay so i have the 5x25 matrix of X where x=[A: B; C; D;E]
A = [2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50];
B = [3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69 72 75];
C = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25];
D = [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 35 36 38 39 30 35 37 39 41];
E = [ 1 5 7 9 2 35 7 9 0 6 7 9 1 3 4 5 8 9 2 0 3 8 3 7 4]
How would i use these vectors from the 5x25 matrix and find the co variance of this? Using the cov function to give a 5x10 matrix?
So far i have tried cov(X) and this is giving a 25x25 matrix so i am doing something wrong here...?
Jan
Jan 2021년 12월 3일
Why do you expect a 5x10 matrix? The covariance is mathematically defined and the givenoutput is the expected one.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by