⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 simexp.m

📁 用matalab开发的随机数生成程序包
💻 M
字号:
function [sample] = simexp(M, N, lambda)

% SIMEXP random numbers from exponential distribution
%   pdf f(x)=lambda exp(-lambda*x), x>0
%
% [sample] = simexp(M, N, lambda)
%
% Inputs: 
%        M - number of rows in the output matrix
%        N - number of columns in the output matrix
%         lambda - parameter of the distribution
%
% Outputs: 
%        sample - a matrix of random numbers
%
% See also SIMBINOM, SIMDISCR, SIMGEOM, SIMPARETO

% Authors: R.Gaigalas, I.Kaj
% v1.3 Created 04-Oct-02
%      Modified 02-Dec-05 to generate a matrix

  % generate a sample of U(0, 1) and apply the inverse cgf
  sample = -log(rand(M, N))./lambda;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -