if true % N = 5000;
z = 2*randn(N,1); x = (-9:0.25:9); z1 = reshape(z,[10,500]); y = mean(z1); sdy = std(y); E = exp(-(x.^2)./(2*(sdy^2))); DeltaNy = (500./(sdy*sqrt(2*pi))).*E.*0.25; plot(x,DeltaNy,'r-'); endI have to use the formula for delta n which depends on the standard deviation of y but this values is too small and I get Subscript indices must either be real positive integers or logicals. I don't know how to make the formula work, I need it to plot the normal distribution on a histogram. I have to use THAT formula and cant change it.
MATLAB: I get Subscript indices must either be real positive integers or logicals.
statisticssubscript
Best Answer