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]

输出:

相关推荐
Ruannn(努力版)12 小时前
statistics
概率论
Zootopia62614 小时前
多架 eVTOL集群排班调度方案思考
人工智能·算法·数学建模·matlab·动态规划·无人机·evtol
Evand J21 小时前
【MATLAB例程】三维快速扩展随机树(RRT)路径规划与到达角(AOA)、到达时间差(TDOA)融合定位,附下载链接
开发语言·matlab·代码·定位·例程
Evand J1 天前
【MATLAB例程】三维A*路径规划与TOA-AOA-TDOA融合定位算法。附下载链接
数据库·算法·matlab
水桶学习吧_1 天前
电网负载无功MATLAB仿真
matlab·cnn·simulink
happy_baymax2 天前
MATLAB2026B 已经公布
matlab
Zootopia6263 天前
快递无人车与无人机各自进入配送网络后,路线能否一起算?
c++·人工智能·机器学习·matlab·ai·机器人·无人机
Evand J3 天前
【MATLAB例程】三维RRT路径规划与TDOA定位算法。有中文注释、包运行成功,文末有完整代码的下载链接
matlab·路径规划·代码·定位
老饼讲解-BP神经网络3 天前
一篇详解-BP神经网络matlab实现例子与方法(newff)
人工智能·神经网络·matlab
通信仿真爱好者3 天前
第【130】期--OFDM系统中LS、MMSE与DFT信道估计方法的仿真--matlab完整代码
matlab·ofdm·dft·ls·信道估计·mmse