Code covered by the BSD License  

Highlights from
Energy Trading & Risk Management with MATLAB Webinar Case Study

image thumbnail

Energy Trading & Risk Management with MATLAB Webinar Case Study

by

 

29 Jun 2010 (Updated )

MATLAB code for the generation asset risk analysis case study

fitPlot(dates, YMatrix1, res1)
function fitPlot(dates, YMatrix1, res1)
%FITPLOT is a modified auto-generated function to create a plot of the actual series,
% model-predicted series and residuals
%
% SYNTAX:
% fitplot(dates, [actual pred], residuals)

%  Auto-generated by MATLAB on 12-Apr-2010 10:34:05

% Create figure
figure1 = figure;

% Create axes
axes1 = axes('Parent',figure1,...
    'Position',[0.13 0.583837209302326 0.775 0.341162790697674]);
box(axes1,'on');
hold(axes1,'all');

% Create multiple lines using matrix input to plot
plot1 = plot(dates, YMatrix1,'Parent',axes1);
set(plot1(1),'DisplayName','Actual');
set(plot1(2),'LineStyle','-','Color',[1 0 0],'DisplayName','Model');

% Create title
title('Data & Model Prediction');

% Create subplot
subplot1 = subplot(2,1,2,'Parent',figure1,'YGrid','on');
box(subplot1,'on');
hold(subplot1,'all');

% Create title
title('Residuals');

% Create plot
plot(dates, res1,'Parent',subplot1,'DisplayName','res');

% Create legend
legend(axes1,'show');

linkaxes([axes1 subplot1], 'x');
dynamicDateTicks([axes1 subplot1], 'linked');

Contact us