필터 지우기
필터 지우기

Correlating through specific rows in matrix

조회 수: 1 (최근 30일)
Elizabeth Yeap
Elizabeth Yeap 2020년 11월 27일
답변: Image Analyst 2020년 11월 27일
Dear all,
I want to correlate a 100*6 matrix against the respective 100*6 in a 1700*6 matrix. How do I go increasing the counter by 100 rows such that i increases 1:100, 101:200, 201:300 and so on?
for i = 1:1700
C_ET(i) = corr(Y_ET(i,:),Y_Compiled(i,:)); % Y_ET = 100*6 & Y_Compiled = 1700*6 matrix
end
Thank you for your help!

채택된 답변

Image Analyst
Image Analyst 2020년 11월 27일
Not exactly sure what you're after, but how about this:
counter = 1;
for i = 1 : 100 : 1700
row1 = i;
row2 = row1 + 99;
C_ET(counter) = corr(Y_ET(row1:row2,:), Y_Compiled(row1:row2,:)); % Y_ET = 100*6 & Y_Compiled = 1700*6 matrix
counter = counter + 1;
end

추가 답변 (0개)

카테고리

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

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by