# "Index in position 1 is invalid. Array indices must be positive integers or logical values."

2 views (last 30 days)

Show older comments

I get the entitled error when ever i run the code below

nu=sum((i-(n+1)/2).*Y(i,:)

for the equation

and also the same error for

de=sqrt(n^3*(sum(Y(i,:)-mean(Y(i,:)))^.2))

for the equation

where first is the numerator and second is the denominator of D, "test for normality was given by D’Agostino"

full code

y1=[51 27 37 42 27 43 41 38 36 26 29]';

y2=[36 20 22 36 18 32 22 21 23 31 20]';

y3=[50 26 41 32 33 43 36 31 27 31 25]';

y4=[35 17 37 34 14 35 25 20 25 32 26]';

y5=[42 27 30 27 29 40 38 16 28 36 25]';

Y=[y1 y2 y3 y4 y5]

Y=sort(Y)

[n p]=size(Y)

nu=sum((i-(n+1)/2).*Y(i,:))

de=sqrt(n^3*(sum(Y(i,:)-mean(Y(i,:)))^.2))

D=nu./de

YY=sqrt(n)*(D-inv(2*sqrt(pi)))/0.02998598

##### 2 Comments

Rik
on 7 Feb 2019

### Answers (1)

### See Also

### Community Treasure Hunt

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

Start Hunting!