在matlab中可以通过cdfplot画出数据的累积分布函数曲线,如下程序:
- clc;
- clear;
- close all;
- warning off;
- x = rand(1,1000).^4;
- cdfplot(x)
运行结果如下:

那么如何从cdfplot中获得对应的数值呢?非常简单,我们将上述程序做如下的调整。
- clc;
- clear;
- close all;
- warning off;
- x = rand(1,1000).^4;
- [xx]=cdfplot(x);
-
- x1 = xx.XData;
- y1 = xx.YData;
-
- figure;
- plot(x1,y1);
运行后,可以看到和直接cdfplot的输出结果一样,这说明x1和y1就是从cdfplot中提取的数据。
