Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 6

%Name: Richard Orraca - Tetteh

%ID:

1200109

%Level: 400
%Information System Sciences
%Date: 4/3/2012

[data, textread] = xlsread('gasprices.xls ' ) ;


% Data is the matrix of values
% textread is for the other characters
Belgium = data(: ,1); %Reference the f i rs t column to Belgium
%Figure
subplot(2,1,1) %Break the f igure window into two
plot(Belgium,'r ' , ' l i newidth' ,2) % Plot the Belgium with red l ine
hold on
France = data(: ,2); %Reference the second column to France
plot(France, 'b ' , ' l i newidth' ,2) % Plot the France with blue l ine
grid on
set(gca, 'xt i ckLabel ' ,{ '0 ' , ' 1996' , '1997' , '1998' , '1999' , '2000' , '2001' , '2002' , ' 2003' , ' 2004' , '2005'})
xlabel( 'years ' )
ylabel( 'pr i ces ' )
ti t le( 'GasPrices' )
legend('Belgium', 'France')
hold off
BFratio = Belgium./France;
subplot (2,1,2)
plot (BFratio, ' l i newidth' ,2)
grid on
set(gca, 'xt i ckLabel ' ,{ '0 ' , ' 1996' , '1997' , '1998' , '1999' , '2000' , '2001' , '2002' , ' 2003' , ' 2004' , '2005'})
xlabel( 'years ' )
ylabel( 'pr i ces ' )
legend('BFratio ' )

Germany = data(:,3); %Reference the third column to Germany


%Figure
subplot(2,1,1) %Break the figure window into two
plot(Germany,'r','linewidth',2) % Plot the Germany with red line
hold on
Italy = data(:,4); %Reference the fourth column to Italy
plot(Italy,'k','linewidth',2) % Plot the italy with black line
grid on
set(gca,'xtickLabel',{'0','1996','1997','1998','1999','2000','2001','2002','2003','2004','2005'})
xlabel('years')
ylabel('prices')
title('GasPrices')
legend('Germany','Italy')

hold off
BFratio = Germany./Italy;
subplot (2,1,2)
plot (BFratio,'linewidth',2)
grid on
set(gca,'xtickLabel',{'0','1996','1997','1998','1999','2000','2001','2002','2003','2004','2005'})
xlabel('years')
ylabel('prices')
legend('BFratio')

Netherlands = data(:,5); %Reference the fifth column to Netherlands


subplot(2,1,1) %Break the figure window into two
plot(Netherlands,'g','linewidth',2) % Plot the Netherlands with green line
hold on

U.K = data(:,6); %Reference the sixth column to U.K


plot(U.K,'k','linewidth',2) % Plot the U.K with black line
grid on
set(gca,'xtickLabel',{'0','1996','1997','1998','1999','2000','2001','2002','2003','2004','2005'})
xlabel('years')
ylabel('prices')
title('GasPrices')
legend('Netherlands','U.K')
hold off
BFratio = Netherlands./U.K;
subplot (2,1,2)
plot (BFratio,'linewidth',2)
grid on
set(gca,'xtickLabel',{'0','1996','1997','1998','1999','2000','2001','2002','2003','2004','2005'})
xlabel('years')
ylabel('prices')
legend('BFratio')

U.S = data(:,7); %Reference the Seventh column to U.S


subplot(2,1,1) %Break the figure window into two
plot(U.S,'y','linewidth',2) % Plot the U.S with yellow line
hold on
U.K = data(:,6); %Reference the sixth column to U.K
plot(U.K,'r','linewidth',2) % Plot the U.K with red line
grid on
set(gca,'xtickLabel',{'0','1996','1997','1998','1999','2000','2001','2002','2003','2004','2005'})
xlabel('years')
ylabel('prices')
title('GasPrices')
legend('U.S','U.K')
hold off
BFratio = U.K./U.S;

subplot (2,1,2)
plot (BFratio,'linewidth',2)
grid on
set(gca,'xtickLabel',{'0','1996','1997','1998','1999','2000','2001','2002','2003','2004','2005'})
xlabel('years')
ylabel('prices')
legend('BFratio')

You might also like