Code covered by the BSD License  

Highlights from
Demo files for "MATLAB for Excel Users" webinar

image thumbnail

Demo files for "MATLAB for Excel Users" webinar

by

 

27 Aug 2010 (Updated )

This is the demo used in March 22, 2011 webinar "MATLAB for Excel Users".

createfigure(serialDate1, Power1, Temperature1)
function createfigure(serialDate1, Power1, Temperature1)
%CREATEFIGURE(SERIALDATE1,POWER1,TEMPERATURE1)
%  SERIALDATE1:  vector of x data
%  POWER1:  vector of y data
%  TEMPERATURE1:  vector of y data

%  Auto-generated by MATLAB on 05-Nov-2009 10:47:26

% Copyright 2010 The MathWorks, Inc.

% Create figure
figure1 = figure;

% Create axes
axes1 = axes('Parent',figure1,'XTickLabel',{'','','','','','','','',''},...
  'Position',[0.13 0.55 0.775 0.38]);
box(axes1,'on');
hold(axes1,'all');

% Create plot
plot(serialDate1,Power1,'Parent',axes1,'Color',[1 0 0],...
  'DisplayName','serialDate vs Power');

% Create ylabel
ylabel('Power (MW)');

% Create title
title('2006 Data');

% Create axes
axes2 = axes('Parent',figure1,'Position',[0.13 0.11 0.775 0.4]);
box(axes2,'on');
hold(axes2,'all');

% Create plot
plot(serialDate1,Temperature1,'Parent',axes2,...
  'DisplayName','serialDate vs Temperature');

% Create xlabel
xlabel('Date');

% Create ylabel
ylabel('Temperature (\circF)');

% Fix date labels
datetick('x', 'mmmyy', 'keepticks');

% Link two axes
linkaxes([axes1 axes2], 'x');

Contact us