If I now go to my desktop, [COUGH], let's hide these windows here's my plot dot PNG

which octave has saved, then you know, that's the figure I have saved as a PNG

file. Octave can save thousands other formats

as well so you can type help plot if you want to see the other file formats,

rather than PNG that you can save figures in.

And lastly, if you want to get ride of a plot, the closed command.

causes a figure to go away, so there's a figure and if I type close, you know,

that figure just disappeared from my just disappeared from my desktop.

Octave also lets you specify a figure or a number.

So you type figure, one, plot T, Y1, that starts up a first figure in that plus T

Y1 and then if you want a second figure you specify a different figure number so

figure two plus T Y2, like so and now on my desktop I actually have two figures,

figure one and figure two, one plotting the sign function, one plotting the

cosign function. Here's one other neat command that I

often use which is the subplot commands, I'm going to use subplots 121 what this

does is divides, subdivides the plots. Into

A one by two grid, that's what the first two parameters are, and in response to,

access the first element, that's the what the final parameter one is, right, so

this, divide my figure into one by two grids and I want to, access the first

element right now, and so if I, take that in, this product, this figure is on the

left and if I, plot T Y1, it now fills up this, .

You know, first element and if I now do subplot one, two, two.

I'm going to start to access the second element and plot T, Y2.

Well, throw in Y2 in the right hand side or the second element.

And lost command you can also change the axis scale and change axis to open five

one minus one, one and this sets the X range and Y range for the figure on

the, on, on the right and [INAUDIBLE] says the horizontal range of values and

the figure on the right to range from 0.5 to one and the vertical axis values to

range from -one to one. And you know, you don't need to memorize

all these commands if you ever need to change the axis all you need to know is

that there's an axis command and you can really get the details from the usual

auto help command. Finally just a couple of last commands -

ClF Clears a figure. And, here's one more neat trick.

Lets set A to be equal to a five by five matrix square, say, so A is now this five

by five matrix. There's a neat trick that I sometimes use

to visualize a matrix, which is I could use image S, C.

Of A and what this would do is this would plot a five by five matrices so it'll

take my matrices I'll plot this as a five by five grid of colors where the

different colors correspond to the different values in the A matrix.

So briefly I an also do color bar let me use a more sophisticated command if we

just see A color bar, color Map gray this is actually running three commands at a

time, running every emesher FC, then running color bar, then color map gray

and what this does, is it sets the color po, map, it's a gray color map, and under

writed also puts it in this color bar and,

So this color bar shows what the different shades of color correspond to,

curan frequently, the upper left elements of, the A matrix is seventeen, and so,

you know, that corresponds to. Kind of a mid shade of grey, whereas in

contrast the second element of a, the one two element of a is 24 versus a one two

is 24. So that corresponds to this graph here

which is nearly a shade of white. And the small value say a, what is that

a, a four five Know is the value three over here that

corresponds. You can see how my color bar that

corresponds to much darker shade in this image.

So here's another example I can plot a larger you know.

Here's a magic fifteen that gives me a fifteen by fifteen magic square and this

gives me a plot of what my fifteen by fifteen magic square's values looks like.

And finally to wrap up this video. What you've seen me do here is use common

training of function cause here is how we actually do this [COUGH], if I type A

plus one, B equals two and C equals three.

And hit enter. Then this, 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 equals one, b equals two, C equals three.

Except that if I use semi colons 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 [INAUDIBLE] color bar, color map.

To put multi commands on the same line. So, that's it.

You now know how to plot different figures in Octave.

And, in the next video. The, the next main piece I want to tell

you about is, how to write control statements.

Like if, while full statements in Octave. As well as how to define and use

functions.