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]

输出:

相关推荐
dracula00010 小时前
Simulink建模助手系列-7【根据From创建Bus Creator】
matlab
dracula0002 天前
Simulink建模助手系列-进阶2【解析Bus总线信号层次结构】
matlab
@陈小鱼2 天前
基于 Savitzky-Golay滤波器的超声图像运动分析方法
python·计算机视觉·matlab·信号处理
guygg883 天前
基于人工神经网络的彩色图像恢复 MATLAB实现
开发语言·计算机视觉·matlab
dracula0003 天前
Simulink建模助手系列-进阶1【界面化并集成到Simulink的右键菜单】
matlab
Evand J4 天前
matlab GUI制作界面的一些笔记(入门)
开发语言·笔记·matlab
dracula0004 天前
Simulink建模助手系列-6【自动调整子系统高度和信号线】
matlab
niuniudengdeng4 天前
基于时序上下文编码的端到端无文本依赖语音分词模型
人工智能·数学·算法·概率论
SCLchuck5 天前
人工智能-概率密度估计
人工智能·python·概率论·概率密度估计
dracula0005 天前
Simulink建模助手系列-4【批量添加信号线】
matlab