%Class for CO907, Tue, Week 1. %__________________________________________ %Author: Jiarui Cao %Date: 5 Nov 2013 %Purpose: Basic probability distributions & QQ plots close all; clear all; clc; clf; %hold all; rng('default'); %random number generating seed. 'default' means it generates same numbers every time. %x = normrnd(10,0.5,100,1); %Generate 100 Gaussian random numbers with mean %\mu=10, \sigma=0.5 x=exprnd(10,100,1);%Exp random number with mean 10 %qqplot(x) % Generate QQ plot of x with std Gaussian distribution %y=exprnd(2,100,1); %qqplot(x,y); %Test if x,y have same distributions. qqplot(x,ProbDistUnivParam('exponential',1));% Genearate QQ plot of x with %specific distribution, e.g. exponential here. Notice, need to change corresponding %parameter(s)