Error using accumarray: First input SUBS must contain positive integer subscripts?

2 次查看(过去 30 天)
Hi all,
I have tried Matlab function ranova but get an error:
Error using accumarray First input SUBS must contain positive integer subscripts.
Error in RepeatedMeasuresModel>makeTestA (line 2172) termsize = accumarray(this.CoefTerms',1);
Error in RepeatedMeasuresModel/ranova (line 659) [A,Anames] = makeTestA(this);
Could someone please let me know how to solve this problem?
Here is how I have tried ranova:
t = table(subjects,means(:,1),means(:,2),means(:,3),'VariableNames',{'sessions','s1','s2','s3'});
t =
sessions s1 s2 s3
_________ ______ ______ ______
'subject' 5.0463 5.3267 5.5495
'subject' 6.0667 7.087 3.322
'subject' 3.1313 7.4503 3.2299
'subject' 16.412 6.1687 5.0404
'subject' 8.824 14.683 6.7319
'subject' 3.8126 2.8653 3.6366
'subject' 27.42 9.1804 8.0514
'subject' 7.0583 4.9728 4.2714
'subject' 3.7724 5.1526 5.678
'subject' 12.036 4.4427 14.088
'subject' 8.5065 5.4886 3.7804
'subject' 6.64 10.418 6.3139
'subject' 5.1549 19.468 9.2322
'subject' 4.6753 4.4866 5.7057
'subject' 3.3991 3.551 3.6003
'subject' 10.692 11.041 4.9977
rm = fitrm(t,'s1-s3~sessions') rm =
RepeatedMeasuresModel with properties:
Between Subjects:
BetweenDesign: [16x4 table]
ResponseNames: {'s1' 's2' 's3'}
BetweenFactorNames: {'sessions'}
BetweenModel: '1 + sessions'
Within Subjects:
WithinDesign: [3x1 table]
WithinFactorNames: {'Time'}
WithinModel: 'separatemeans'
Estimates:
Coefficients: [1x3 table]
Covariance: [3x3 table]
ranovatbl = ranova(rm)
Thanks, Maria

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Repeated Measures and MANOVA 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by