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

1 view (last 30 days)
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

Answers (1)

Walter Roberson
Walter Roberson on 15 Nov 2019
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 ?

Categories

Find more on Structures in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!