Write a program to implement Testing for Standard Normal Distribution in matlab:- ans
Answers
Answered by
1
Answer:
Task to be done: Standard Normal Distributionlanation:
code:-
N=1000
norm_mean=1;
norm_var=2;
x=norm_mean+sqrt(norm_var)*randn(1,N);
% mean=0 and var=1 std. normal distribution
nob=10; %number of bins
a=min(x);
b=max(x);
aa=linspace(a,b,nob); %linspace linearly space vector
count(size(aa))=0;
for i=1:length(aa)-1
for j=1:length(x)
if (x(j)>=aa(i) && x(j)<aa(i+1))
count(i)=count(i)+1;
end
end
y(i)=(aa(i)+aa(i+1))/2;
end
%bar(y,count(1:end-1)/N);
%pie(y,count(1:end-1/N);
plot(y,count(1:end-1)/N);
Similar questions