matlab均匀分布图绘制

matlab均匀分布图绘制

>>  x4 = rand([100,1]);
>> xi4 = linspace(-10,20,201);
>> F = ksdensity(x4,xi4,'function','cdf');
>> plot(xi4,F); 

 

a5=1;
b5=10;
x5=0:0.5:12;

for i=1:length(x5)
    y5(i)=(x5(i)-a5)/(b5-a5);
    if y5(i)>1
        y5(i)=1;
    end
    if y5(i)<0
        y5(i)=0;
    end
end

plot(x5,y5)

 

posted @ 2020-09-19 20:04  西北逍遥  阅读(2157)  评论(0编辑  收藏  举报