matlab概率论例子

  1. 高斯概率模型:
bash 复制代码
[f,xi] = ksdensity(x): returns a probability density estimate, f, for the sample in the vector x. 
The estimate is based on a normal kernel function, and is evaluated at 100 equally spaced points, xi, that cover the range of the data in x.

代码:

bash 复制代码
>> %Give a random sample
x=[2*randn(6000,1); 5+randn(4000,1)];
%Calculate the probability density of each point
[f,xi]=ksdensity(x);
%plot
subplot(211);
plot(x);
title('Sample Data')
subplot(212);
plot(xi,f);
title('PDF');
>> 

图形:

  1. 产生高斯样本点

代码:

bash 复制代码
clear all;  clc;
N=6;
s01=randi([0,1],N,1); % 01 random sequence
s=2*s01-1;    % +1-1 random sequence
w=randn(N,1); % Gaussian distribution
x=rand(N,1);  % Uniform  distribution
[s01,s,w,x]

输出:

相关推荐
listhi52018 小时前
IMM雷达多目标跟踪MATLAB实现方案
人工智能·matlab·目标跟踪
Gofarlic_OMS19 小时前
如何将MATLAB网络并发许可证闲置率降至10%以下
大数据·运维·服务器·开发语言·人工智能·matlab·制造
指掀涛澜天下惊20 小时前
概率论 - 贝叶斯定理
人工智能·机器学习·概率论·贝叶斯定理·贝叶斯公式
s09071361 天前
【MATLAB】多子阵合成孔径声纳(SAS)成像仿真——基于时域反向投影(BP)算法
算法·matlab·bp算法·合成孔径
pythonpapaxia1 天前
基于Matlab的车牌识别完整教程:从图像预处理到字符识别实战解析
图像处理·其他·计算机视觉·matlab
kaikaile19951 天前
A星算法避开障碍物寻找最优路径(MATLAB实现)
数据结构·算法·matlab
民乐团扒谱机1 天前
【微实验】数模美赛备赛:多目标优化求解实战(MATLAB实现,以流水车间调度为例)
开发语言·数学建模·matlab·甘特图·遗传算法·多目标优化·优化模型
fie88891 天前
MATLAB有限元框架程序
python·算法·matlab
wearegogog1231 天前
基于MATLAB的IEEE 9节点系统潮流计算
开发语言·matlab
ghie90901 天前
基于粒子滤波的多目标检测前跟踪(TBD)MATLAB实现
人工智能·目标检测·matlab