Problem in drawing

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 Graphic shows is not clear,why???
can any one tell me
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

 채택된 답변

Matt Fig
Matt Fig 2011년 4월 10일

0 개 추천

I get a graph, why do you say you don't get a graph? You don't say what to use for the requested input, so I used 10000. Is that wrong? If so, what should we use?

댓글 수: 3

reem
reem 2011년 4월 10일
also,I get a graph but I think the result of graph is not true,if I
enter 100 or 10000,the number of realization is not problem for me
but I expect that the drawing is incorrect
Because it is not systematic
I want to use the plot, hist for drawing my program not bar command
But there is no any result when I used the (plot and hist command)at
the same time
this is my problem here!
Matt Fig
Matt Fig 2011년 4월 10일
Is there a website or link you can put up which shows the kind of outcome you expect?
reem
reem 2011년 4월 10일
The result should show close to such a drawing(not the same but near to such drawing)
http://www.dreamcalc.com/dchelp/chart_histogram.gif

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Graphics Performance에 대해 자세히 알아보기

태그

질문:

2011년 4월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by