# How can I combine two vectors with different lenghts and indexes into one sum.

조회 수: 11 (최근 30일)
Ruslan Askarov . 2023년 5월 25일
댓글: Ruslan Askarov . 2023년 5월 26일
I have different power measurements in two clusters and one time scale (excess delay). and I should compute RMS value according this formula where Pi consists of sum of values from both clusters.
I cannot figure out way to start second vector (power values of cluster 2) from index 3. OR should I write IF conditions??
I would appreciate any help :)

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

### 채택된 답변

편집: Askic V 님. 2023년 5월 25일
You obviously have missing values in your table. This is how I would approach to this problem:
tau = 0:10:80;
mu_tau = mean(tau);
Pc1 = [0,-5.4,-10.8,-16.2,-21.7,NaN,NaN,NaN,NaN];
Pc2 =[NaN,NaN,-3.2,-6.3,-9.4,-12.5,-15.6,-18.7,-21.8];
P = Pc1+Pc2;
RMS_val = sqrt(sum((tau-mu_tau).^2 .* P, 'omitmissing')/sum(P,'omitmissing'))
RMS_val = 10.7761
##### 댓글 수: 1표시 없음숨기기 없음
Sure, That's it! Thank you.

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

### 카테고리

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

R2020b

### Community Treasure Hunt

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

Start Hunting!