使用MATLAB绘制平滑累积分布函数 [英] Plot smooth cumulative distribution function using MATLAB

查看:1012
本文介绍了使用MATLAB绘制平滑累积分布函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使以下累积分布函数(CDF)曲线更平滑?

How is it possible to make the following cumulative distribution function (CDF) curve smoother?

这是我的代码,使用 cdfplot :

clear all; 
close all;
y = [0.75862069 0.666666667 0.882352941 0.875 0.736842105 0.566666667 0.703703704 0.6 0 0.730769231 0.714285714 0.625 0.675 0.693877551 0.731707317 0.558823529 0.679245283 0.740740741 0.785714286 0.789473684 0.615384615 0.6 0.739130435 0.576923077 0 0.75];
cdfplot(y)

情节如下:

推荐答案

data = [1 2 2 3 4];
dsum = sum(data);
normalized_data = data/dsum;

cdf = data;

for i = 1:length(data)
    cdf(i) = sum(normalized_data(1:i));
end

plot(cdf);

这是您要寻找的吗?

这篇关于使用MATLAB绘制平滑累积分布函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆