How to find cumulative distribution function from a given data set(vector)
35 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Shankul Saini
el 24 de Nov. de 2022
Comentada: Shankul Saini
el 24 de Nov. de 2022
clc
clear all
rng('default') % For reproducibility
y = evrnd(0,3,100,1);
[a,s]=cdfplot(y);
In this "cdfplot "directly plots the cdf graph, that too is repeats the each number then finds cdf.
But I want the cdf vector.
Can someone help me please?
0 comentarios
Respuesta aceptada
Paul
el 24 de Nov. de 2022
Hi Shankul,
I'm not sure what "I want the cdf vector" means. If that means the data that forms the cdf plot on the graph, then the data can be obtained from the XData and YData properties of a:
rng('default') % For reproducibility
y = evrnd(0,3,100,1);
[a,s]=cdfplot(y);
plot(a.XData,a.YData)
If that's not what you want, can the Question be clarified?
3 comentarios
Paul
el 24 de Nov. de 2022
rng('default') % For reproducibility
y = evrnd(0,3,100,1);
[a,s]=cdfplot(y);
[f,x]=ecdf(y);
hold on
plot(x,f)
whos x f y
The extra point in x and f is the first where x(1) = x(2) and f(1) = 0;
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!