JGuizard
7/6/2016 - 7:21 PM

plotting.matlab

%line graph
t=[0:0.01:0.98]
y = sin(2*pi*4*t)
plot(t,y)

%plot two graph together
t=[0:0.01:0.98]
y1 = sin(2*pi*4*t)
plot(t,y1)
hold on
y2 = cos(2*pi*4*t)
plot(t,y2,'r')
% clear the graph
clf
%close the graph
close

%add information
xlabel('time')
ylabel('value')
legend('sin','cos')
title('My plot')

% save to png
print -dpng 'myplot.png'

%
imagesc(m, colorbar, colormap)