matlab memo 001: plot & display a photo

Lesson 1 The MATLAB Environment

clear
clc

plot

x_coordinates = [1,3,10];
y_coordinates = [2,4.2,12.3];
plot(x_coordinates,y_coordinates);
length(x_coordinates)
%plot each point separately
plot(x_coordinates,y_coordinates,'*');
%search documentation
doc plot
plot(x_coordinates,y_coordinates,'rs');
grid on
%add labels
xlabel('Selection')
ylabel('Change')
title('Changes in Selection during the Past Year')
%change the range of x & y
axis([0,12,-10,20])
%bar graph
bar(x_coordinates,y_coordinates)
%make a new figure window(/tab)
figure
%pie chart
pie([4 2 7 4 7])
%close the figure window two
close(2)
%close all figure windows
close all

display a photo

%a wrong way
imread('filename.jpg');
%a correct way
brainphoto=imread('wm_brain_regions.jpg');
image(brainphoto)
axis off