MATLAB Answers

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)
Nadiyah Browning
Nadiyah Browning on 15 Nov 2019
Answered: Walter Roberson on 15 Nov 2019
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.

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 ?

  0 Comments

Sign in to comment.


Translated by