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

1 次查看(过去 30 天)
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

回答(1 个)

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

类别

Help CenterFile Exchange 中查找有关 Structures 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by