Well, throw in y2 in

the right hand side, or in the second element.

And last command, you can

also change the axis scales

and change axis these to 1.51

minus 1 1 and this

sets the x range

and y range for the

figure on the right,

and concretely, it assess the horizontal

major values in the figure

on the right to make sure 0.5

to 1, and the vertical

axis values use the range from minus one to one.

And, you know, you don't need to memorize all these commands.

If you ever need to

change the access or you

need to know is that, you know, there's an

access command and you can

already get the details

from the usual octave help command.

Finally, just a couple last

commands CLF clear is

a figure and here's one unique trait.

Let's set a to be equal

to a 5 by 5

magic squares a. So, a

is now this 5 by 5

matrix does a neat

trick that I sometimes use to

visualize the matrix, which is

I can use image sc

of a what this will

do is plot a five

by five matrix, a five by five grid of color.

where the different colors correspond to

the different values in the A matrix.

So concretely, I can also do color bar.

Let me use a

more sophisticated command, and image sc

A color bar

color map gray.

This is actually running three commands at a time.

I'm running image sc then running

color bar, then running color map gray.

And what this does, is it sets

a color map, so a

gray color map, and on the

right it also puts in this color bar.

And so this color bar

shows what the different shades of color correspond to.

Concretely, the upper left

element of the A matrix

is 17, and so that corresponds

to kind of a mint shade of gray.

Whereas in contrast the second

element of A--sort of the

1 2 element of A--is 24.

Right, so it's A 1 2 is 24.

So that corresponds to

this square out here, which is

nearly a shade of white.

And the small value, say

A--what is that? A

4 5, you know, is a value

3 over here that corresponds--

you can see on my color bar

that it corresponds to a

much darker shade in this image.

So here's another example,

I can plot a larger, you

know, here's a magic 15 that

gives you a 15 by 15

magic square and this

gives me a plot of what

my 15 by 15 magic squares values looks like.

And finally to wrap

up this video, what you've

seen me do here is

use comma chaining of function calls.

Here's how you actually do this.

If I type A equals

1, B equals 2, C equals

3, and hit Enter, then

this is actually carrying out

three commands at the same time.

Or really carrying out three

commands, one after another,

and it prints out all three results.

And this is a lot like

A equals 1, B equals

2, C equals 3, except

that if I use semicolons instead

of a comma, it doesn't print out anything.

So, this, you know,

this thing here we call comma

chaining of commands, or comma chaining of function calls.

And, it's just another

convenient way in Octave to

put multiple commands like image sc

color bar, colon map

to put multi-commands on the same line.

So, that's it.

You now know how to plot

different figures and octave, and

in next video the

next main piece that I want

to tell you about is how to

write control statements like if,

while, for statements and

octave as well as hard to define and use functions