필터 지우기
필터 지우기

confused graph,probability

조회 수: 3 (최근 30일)
reem
reem 2011년 4월 9일
After greeting and respect
Every time when I want to do my program,everything is stop in graph
(plot),I know how to do the program but the main problem for me in
plot,so this is my program and I have problem in plot(graph)
rand('state',0)
M=input('Enter the number of realization:');
count=0;
X=randn(M,1);
proestimated = zeros(size(X));
for k=1:M
if X(k)>2
count=count+1;
end
end
proestimated = count/M;
disp('estimated probability:')
display(proestimated)
y=@(X)(1/sqrt(2*pi))*exp(-0.5*X.^2); % Anonymous func.
True_probability = quadgk(y,2,inf)
bar(X,True_probability);
hold on
grid on
xlabel('X');
ylabel('True probability');
title('True probability pdf');
bar(X,proestimated);
hold on
grid on
xlabel('X');
ylabel('Estimated probability');
title('Estimated probability pdf');
anybody help me in plot the graph in my program
Thanks in advance

답변 (1개)

Jim Dowd
Jim Dowd 2011년 4월 9일
What do you typically enter for number of realization?
  댓글 수: 1
reem
reem 2011년 4월 10일
100
you can enter any number

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Networks에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by