Hi, I am getting the following Matlab error: "Input to EIG must not contain NaN or Inf." when I run the fitrm function. I am trying to test the differences between the 6 levels. I have 18 subjects and 6 levels. My table with the formatted data looks like this: The code: subj = {'Subj1','Subj2','Subj3','Subj4','Subj5','Subj6','Subj7','Subj8','Subj9','Subj10','Subj11','Subj12','Subj13','Subj14','Subj15','Subj16','Subj17','Subj18'}'; t_loud_fc = table(subj,fc_y_250_mean,fc_y_500_mean,fc_y_1000_mean,fc_y_2000_mean,fc_y_3000_mean,fc_y_4000_mean,... 'VariableNames',{'subj','Cond1','Cond2','Cond3','Cond4','Cond5','Cond6'}); cond_loud_fc = dataset([1 2 3 4 5 6]','VarNames',{'Conditions'}); rm_loud_fc = fitrm(t_loud_fc,'Cond1-Cond6~subj','WithinDesign',cond_loud_fc); ranovatbl_loud_fc = ranova(rm_loud_fc); The output from the console window is: Error using eig Input to EIG must not contain NaN or Inf. Error in RepeatedMeasuresModel>mauchlyTest (line 1921) lam = eig(C'*S*C); Error in RepeatedMeasuresModel.fit (line 1369) [this.Mauchly,this.Epsilon] = mauchlyTest(this.Cov,size(Xmat,1),rank(Xmat)); Error in fitrm (line 67) s = RepeatedMeasuresModel.fit(ds,model,varargin{:}); Error in RunStatAnalysis (line 51) rm_loud_fc = fitrm(t_loud_fc,'Cond1-Cond6~subj','WithinDesign',cond_loud_fc); I have traced the problem to line 1347 in RepeatedMeasuresModel.m. Here, the variable dfe is equal to zero and thus the covariance becomes 0 as well.. How do I avoid this? The variable dfe is given by dfe = size(Xmat,1)-size(Xmat,2); , where Xmat is a 18x18 matrix and thus dfe becomes zero....
John Williams answered .
2025-11-20