MATLAB Answers

0

Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.

Asked by Nadiyah Browning on 15 Nov 2019 at 2:19
Latest activity Answered by Walter Roberson
on 15 Nov 2019 at 2:27
clear all
load Data_allRT.mat
load exptM.mat
load Data_part1.mat
load Data_part2.mat
m=0;
for n=1:10000;
x = shuffledData_part1;
y = shuffledData_part2;
[h,p]=ttest2(x',y');
DD(n)=p;
if p<0.05;
m=m+1;
end
end

  0 Comments

Sign in to comment.

1 Answer

Answer by Walter Roberson
on 15 Nov 2019 at 2:27

If your x and y are 2D arrays (not vectors) with more than 1 column, then h and p will have one entry per column.
Note that ttest2() is deterministic and that you are running the same test each time. Perhaps you had intended to index one row or one column each iteration ?

  0 Comments

Sign in to comment.