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]

输出:

相关推荐
The hopes of the whole village3 小时前
matlab 绘图
开发语言·matlab·信息可视化
程高兴13 小时前
基于Matlab的车牌识别系统
开发语言·matlab
XuX0316 小时前
手搓雷达图(MATLAB)
matlab·贴图
freexyn20 小时前
Matlab自学笔记五十一:(推荐)输入参数的数量和可变数量的输入
笔记·算法·matlab
不吃酸的柠檬20 小时前
MATLAB 中的图形绘制
人工智能·机器学习·matlab
studyer_domi20 小时前
Matlab 复合模糊PID
开发语言·matlab
DarrenPig2 天前
【新能源科学与技术】MATALB/Simulink小白教程(一)实验文档【新能源电力转换与控制仿真】
matlab·开源·github·simulink·交流
简简单单做算法2 天前
基于GA遗传优化TCN-BiGRU注意力机制网络模型的时间序列预测算法matlab仿真
matlab·tcn-bigru·时间序列预测·注意力机制·ga遗传优化
Cc小跟班2 天前
MATLAB小技巧记录(特殊符号、图例位置...)
开发语言·算法·matlab
随风飘摇的土木狗3 天前
【MATLAB第116期】基于MATLAB的NBRO-XGBoost的SHAP可解释回归模型(敏感性分析方法)
matlab·gsa·敏感性分析·特征排序·灵敏度分析·shap·可解释