Code covered by the BSD License  

Highlights from
SAE Paper Demo: Model-Based Design of Hybrid Electric Vehicles

image thumbnail

SAE Paper Demo: Model-Based Design of Hybrid Electric Vehicles

by

 

07 Nov 2010 (Updated )

Demo files to accompany the paper by the same name

mode_comparison.m
ymatrix1=[ 433.8262 0; 77.3018 18.7209; 49.0563 34.3640];
%CREATEFIGURE(YMATRIX1)
%  YMATRIX1:  bar matrix data

%  Auto-generated by MATLAB on 31-Aug-2007 17:21:19

% Create figure
figure1 = figure;

% Create axes
axes1 = axes('Parent',figure1,...
    'XTickLabel',{'Normal','Accelerator','Rapid Accelerator'},...
    'XTick',[1 2 3],...
    'FontSize',14,...
    'FontName','Verdana');
box('on');
grid('on');
hold('all');

% Create multiple lines using matrix input to bar
bar1 = bar(ymatrix1,'BarLayout','stacked','Parent',axes1);
set(bar1(1),'DisplayName','Running the model');
set(bar1(2),'DisplayName','Generating code');

% Create xlabel
xlabel('Simulation Mode','FontWeight','bold','FontSize',16,...
    'FontName','Verdana');

% Create ylabel
ylabel({'Time Taken (seconds)'},'FontWeight','bold','FontSize',14,...
    'FontName','Verdana');

% Create title
title({'Simulation Performance'},'FontWeight','bold','FontSize',18,...
    'FontName','Verdana');

% Create legend
legend1 = legend(axes1,'show');
set(legend1,'Visible','off','Position',[0.5442 0.6439 0.2344 0.08272]);

% Create textbox
annotation(figure1,'textbox','String',{'Generating code'},...
    'FontWeight','bold',...
    'FontSize',12,...
    'FontName','Verdana',...
    'FitBoxToText','off',...
    'LineStyle','none',...
    'Position',[0.6821 0.2026 0.1719 0.04431],...
    'Color',[1 1 1]);

% Create textbox
annotation(figure1,'textbox','String',{'Running the model'},...
    'FontWeight','bold',...
    'FontSize',12,...
    'FontName','Verdana',...
    'FitBoxToText','off',...
    'LineStyle','none',...
    'Position',[0.681 0.1089 0.2716 0.06381],...
    'Color',[1 1 1]);

% Create textbox
annotation(figure1,'textbox','String',{'10 seconds','of simulation'},...
    'FontWeight','bold',...
    'FontSize',12,...
    'FontName','Verdana',...
    'FitBoxToText','off',...
    'Position',[0.5748 0.7555 0.1234 0.06727]);

Contact us