Code covered by the BSD License  

Highlights from
Data Analysis with MATLAB for Excel Users

image thumbnail
from Data Analysis with MATLAB for Excel Users by Michael Agostini
Materials for public seminar of the same name (slides and demos)

myscript_template

Contents

Import Data

data    = xlsread('January.xls', 'SOP'    , 'B2:Y32');
DayType = xlsread('January.xls', 'Weather', 'B2:B32');
HDD     = xlsread('January.xls', 'Weather', 'C2:C32');
Temp    = xlsread('January.xls', 'Weather', 'D2:D32');

Visualize

createfigure2(data)

Examine Distribution

averageDayProfile = mean(data);
res = data - repmat(averageDayProfile, 31, 1);
mydist(res)

Visualize Confidence Intervals

plotCI(data)

Energy Usage Predictions

singleDay = data(DayType == 1, :);
[singleDayMean, singleDayStDev, singleDayCI] = normfit(singleDay);
sysLoad = singleDayMean(15)
sysLoadCI = singleDayCI(:, 15)
figure;
plot(singleDay')
hold on;
plot(singleDayMean, 'linewidth', 4);
plot([15;15], sysLoadCI, 'r', 'linewidth', 2)
plot(15, sysLoad, 'r.', 'markersize', 40)
sysLoad =
       50.016
sysLoadCI =
       48.082
       51.949

Contact us at files@mathworks.com