Lesson: a Matlab Plot (creating and printing figures)
to make simple MATLAB plots and print them out.
This lesson teaches you the most basic graphic commands.
If you end an instruction with ';',
you will not see the output for
that instruction. MATLAB keeps the results in memory until you let the
Follow this example, step-by-step.
The video shows you the main idea. Below the video, you can see all the
details of the code...
In the command window, you first create a variable named
assign 360 values, from 0 to 2*pi (the constant 'pi' is already
>> angle = linspace(0,2*pi,360);
Now, create appropriate horizontal
values for those angles:
those (x,y) created
Set the scales of the two axes
to be the same:
Put a title
on the figure:
>> title('Pretty Circle')
Label the x-axis
and the y-axis
with something explanatory:
the plot is always optional but valuable:
>> grid on
You now see the figure:
command sends the current plot to the printer connected to
The arguments of the axis,
commands are text
strings. Text strings are entered within single quotes (').
Do you like your plot? Interesting and funny, isn't it?
'Matlab Plot' to home
Plot' to 'Matlab Tutorial'
of Contents / Search