Since you are new, let us show you how Trendy works.


Plot of ratio between cost of petrol and cost of oil in the UK

Plot Image
% Price of Oil (per barrel) (1 barrel is 160 litres)
%   time vector is: time1449
%   data vector is: data1449
% Exchange rate for GBP per USD
%   time vector is: time1793
%   data vector is: data1793
% Average cost of unleaded petrol in the UK (pence per litre)
%   time vector is: time1855
%   data vector is: data1855

% The several trends used are of differing length - match them 
% up so we only plot where the data overlap
[time, IA, IB] = intersect(floor(time1449), floor(time1793));
[time, IC, ID] = intersect(time, floor(time1855));

oilPrice    = data1449(IA(IC));
conversion  = data1793(IB(IC));
petrolPrice = data1855(ID);

costOfOilInPencePerLitre = 100*oilPrice ./ 160 ./ conversion;

plot(time, petrolPrice./costOfOilInPencePerLitre, 'o-');
title('Ratio of cost of petrol to cost of oil')

    Add Tags