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]

输出:

相关推荐
林中漫步—柚11 小时前
线性代数期末判断题总错?矩阵的秩与方程组结论清单(带成立条件)
线性代数·学习笔记·概率论·考研数学·期末复习
Evand J1 天前
【CIR系列2】UWB视距(LOS)与非视距(NLOS)信道冲激响应(CIR)建模与对比,MATLAB
开发语言·matlab·信号处理·nlos·cir
星夜离尘561 天前
MATLAB:标定表局部倒退,为什么不能排序?
android·开发语言·matlab
星夜离尘561 天前
MATLAB:前后各滤一次,为什么相位回来了,幅值却变成 0.500?
开发语言·matlab
FL16238631291 天前
MATLAB R2026b下载和安装教程
开发语言·matlab
星夜离尘562 天前
MATLAB:两路读数平均相差 8 mV,换位能分出传感器偏差和通道偏差吗?
开发语言·matlab
星夜离尘563 天前
MATLAB:同一组 ADC 转换阈值,为什么端点 INL 和拟合 INL 不一样?
linux·数据库·matlab
Evand J4 天前
【MATLAB例程,无人机避障7】基于RRT*与人工势场法(RRT*+APF)的多无人机二维动态路径规划与避障。附下载链接
开发语言·matlab·无人机·rtt·路径规划·人工势场
Evand J10 天前
【MATLAB例程】基于改进人工势场法(Improved APF)的多无人机动态路径规划与避障。附下载链接
matlab·路径规划·apf·人工势场法
tellmewhoisi12 天前
深度学习0:数学知识:最大似然推导过程
人工智能·深度学习·概率论