Still using this example that there for lowercase a.

If I do a < 3, this does the element wise operation.

Element wise comparison, so the first element of A is less than three so

this one.

Second element of A is not less than three so this value says zero cuz it's false.

The third and fourth elements of A are less than three, so that's just 1 1.

So that's the element-wise comparison of all four elements of the variable a < 3.

And it returns true or false depending on whether or not there's less than three.

Now, if I do find(a < 3), this will tell me which are the elements of a,

the variable a, that are less than 3,

and in this case, the first, third and fourth elements are less than 3.

For our next example, let me set a to be equal to magic(3).

The magic function returns, let's type help magic.

The magic function returns these matrices called magic squares.

They have this, you know, mathematical property that all of their rows and

columns and diagonals sum up to the same thing.

So, you know, it's not actually useful for machine learning as far as I know, but

I'm just using this as a convenient way to generate a three by three matrix.

And these magic squares have the property that each row, each column,

and the diagonals all add up to the same thing, so

it's kind of a mathematical construct.

I use this magic function only when I'm doing demos or when I'm teaching octave

like those in, I don't actually use it for any useful machine learning application.

But let's see, if I type RC = find(A > 7) this finds

All the elements of A that are greater than equal to seven,

and so r, c stands for row and column.

So the 1,1 element is greater than 7, the 3,2 element is greater than 7, and

the 2,3 element is greater than 7.

So let's see.

The 2,3 element, for example, is A(2,3),

is 7 is this element out here, and that is indeed greater than equal seven.

By the way, I actually don't even memorize myself what these find functions do and

what all of these things do myself.

And whenever I use the find function, sometimes I forget myself exactly what it

does, and now I would type help find to look at the document.

Okay, just two more things that I'll quickly show you.

One is the sum function, so here's my a, and then type sum(a).

This adds up all the elements of a, and if I want to multiply them together,

I type prod(a) prod sends the product, and

this returns the product of these four elements of A.

Floor(a) rounds down these elements of A, so 0.5 gets rounded down to 0.

And ceil, or ceiling(A) gets rounded up to the nearest integer,

so 0.5 gets rounded up to 1.

You can also, let's see.

Let me type rand(3), this generates a three by three matrix.

If i type max(rand(3), what this does is it takes

the element-wise maximum of 3 random 3 by 3 matrices.

So you notice all of these numbers tend to be a bit on the large side because

each of these is actually the max of a element