Average matrices by limiting the content

조회 수: 1 (최근 30일)
Elaheh
Elaheh 2018년 4월 4일
댓글: Elaheh 2018년 4월 4일
I have two columns (Block,1,2,3; and Type, 6,7,8,12,13,14). Also, I have 10 columns of Reaction times for 10 people. The number of rows is 399 for each block, meaning 399 words in each block (399*3 total). I need to average all the 6 types for each block separately for all columns. I have come up with the following script for Block 1 , Type 6 but it seems it does not select only the reaction times in the first block and type 6.
for k=1:size(Block,1)
for r=1:size(Block,2)
if Block(k,r)==1 && Type(k,r)==6
b=0;
for m=1:size(RTc,1)
for n=1:size(RTc,2)
M_type6=mean(RTc,'omitnan');
b=b+1;
end
end
else
;
end
end
end
  댓글 수: 4
Bob Thompson
Bob Thompson 2018년 4월 4일
Could you give examples of how your data is organized? I'm unsure still how things are related.
Elaheh
Elaheh 2018년 4월 4일
The image is attached. This is the beginning of the file, it goes further down for the second and third blocks and other types.

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

답변 (1개)

Elaheh
Elaheh 2018년 4월 4일
1 6 661 658 875 836 818 1133 533 600 658 NaN 1 6 531 690 937 741 NaN 630 486 921 1022 652 1 6 774 884 1208 985 NaN 773 NaN 722 636 NaN 1 6 579 674 651 811 643 639 595 695 629 NaN 1 12 NaN 698 719 731 813 607 573 1224 572 927 1 12 609 740 667 566 824 634 442 668 739 704

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by