Problem in drawing
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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
0 comentarios
Respuesta aceptada
Matt Fig
el 10 de Abr. de 2011
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 comentarios
Matt Fig
el 10 de Abr. de 2011
Is there a website or link you can put up which shows the kind of outcome you expect?
Más respuestas (0)
Ver también
Categorías
Más información sobre Graphics Performance en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!