Now, and I can also

set V equals one colon six,

and that sets V to be these numbers.

1 through 6, okay.

Now here are some other ways to generate matrices.

Ones 2.3 is a command

that generates a matrix that

is a two by three matrix

that is the matrix of all ones.

So if I set that c2

times ones two by

three this generates a

two by three matrix that is all two's.

You can think of this as a

shorter way of writing this and

c2,2,2's and you can

call them 2,2,2, which would also give you the same result.

Let's say W equals one's, one

by three, so this is

going to be a row vector

or a row of

three one's and similarly

you can also say w equals

zeroes, one by

three, and this generates a matrix.

A one by three matrix of all zeros.

Just a couple more ways to generate matrices .

If I do W equals

Rand one by three,

this gives me a one

by three matrix of all random numbers.

If I do Rand

three by three.

This gives me a three by

three matrix of all

random numbers drawn from the

uniform distribution between zero and one.

So every time I do

this, I get a different

set of random numbers drawn

uniformly between zero and one.

For those of you that

know what a Gaussian random variable

is or for those of you that

know what a normal random variable

is, you can also set W

equals Rand N, one by three.

And so these are going

to be three values drawn from

a Gaussian distribution with mean

zero and variance or

standard deviation equal to one.

And you can set more complex

things like W equals minus

six, plus the square root

ten, times, lets say

Rand N, one by ten thousand.

And I'm going to put a semicolon at

the end because I don't really want this printed out.

This is going to be a what?

Well, it's going to

be a vector of, with

a hundred thousand, excuse me, ten thousand elements.

So, well, actually, you know what?

Let's print it out.

So this will generate a matrix like this.

Right?

With 10,000 elements.

So that's what W is.

And if I now

plot a histogram of W

with a hist command, I can

now. And Octave's print hist

command, you know, takes a

couple seconds to bring this up,

but this is a histogram of

my random variable for W.

There was minus 6 plus zero

ten times this Gaussian random variable.

And I can plot a histogram with

more buckets, with more bins, with say, 50 bins.

And this is my

histogram of a Gaussian with mean minus 6.

Because I have a minus

6 there plus square root 10 times this.

So the variance of

this Gaussian random variable

is 10 on the standard deviation is

square root of 10, which is about what?

Three point one.