%% Analyzing Gas Price Data %% Double click on 'Gas1.xls' to import data [data, textdata] = xlsread('Gas1.xls'); %% Extract Dates dates = textdata(2:end,1); disp(dates(1:5)) %% Extract Category Names cats = textdata(1, 2:end) %% Keep track of the size of the original matrix originalsize = size(data) %% Smooth the data (turning it into a vector) data = smooth(data); size(data) %% Restore the data's shape as a matrix data = reshape(data, originalsize); disp(data(1:5,:)) %% Plot plot(data) set(gca, 'xTickLabel', dates); legend(cats, 'Location', 'Best'); set(gcf, 'Position', [100 100 800 600]); %% Look for Correlations corr(data)