You are on page 1of 26

MATLAB

Tanvir Allidina
Data from electric vehicle
OBDII Bluetooth
logger

Nissan Leaf
used to
collect data

An example of
logged speed
profile over the trip
distance.

CAN bus logger


2
Example of data collected from electric vehicle
Log_U0006387_170201_740d0.xlsx

3
Importing data from an Excel file
• Can be done in many ways:
• xlsread – reads xlsx files only.
• importdata – enables importing data from
many different formats.
• readtable - imports data from many different
formats into table structure.
• using import data wizard – very useful for
beginners. If importdata recognizes the file
extension, it calls the MATLAB
function designed to import the
associated file format. Otherwise,
importdata interprets the file as a
delimited text file. 4
Importing data from an Excel file
[NUM,TXT,RAW]=xlsread(FILE) reads data from the first worksheet in the
Microsoft Excel spreadsheet file named FILE and returns the numeric data in array
NUM. Optionally, returns the text fields in cell array TXT, and the unprocessed data
(numbers and text) in cell array RAW.

Example:
my_data= xlsread('Log_U0006387_170201_740d0.xlsx');

Result of the above operation is stored in a numeric array. Non-numeric data were not
imported.

5
Importing data from an Excel file
A = importdata(FILENAME) loads data into A.

Example:
my_data2=importdata('Log_U0006387_170201_740d0.xlsx');

Result of the above operation is stored in a struct structure.

6
Importing data from an Excel file
T = readtable(FILENAME) creates a table by reading from the file
FILENAME, and determines the file format from its extension.

Example:
my_data3= readtable('Log_U0006387_170201_740d0.xlsx');

Result of the above operation is stored in a table structure.

Table is an array with named variables that can contain different types

7
Importing data from a file
Import data wizard:
21
Data from electric vehicle trials
OBDII Bluetooth
logger

Nissan Leaf
used to
collect data

An example of
logged speed
profile over the trip
distance.

CAN bus logger


2
2
Task 2.2: Electric vehicle performance
150 8

Speed [km/h]
6
100

Gear
4
50
2

0 0
0 500 1000 1500 2000 0 500 1000 1500 2000
Time [s] Time [s]

160 80
Elevation [m]

SOC [%]
70
140
60
120
50
100
40
0 500 1000 1500 2000 0 500 1000 1500 2000
Time [s] Time [s]

400 300

380 200

Current [A]
Voltage [V]

360 100

340 0

320 -100
0 500 1000 1500 2000 0 500 1000 1500 2000
Time [s] Time [s]

2
3
Task 2.3: Power consumption
Motor, Auxiliary, A/C and Battery Power Against Time
100
Motor Power
Auxiliary Power
A/C Power
Battery Power
80

60

40
Power (kW)

20

-20

-40
0 200 400 600 800 1000 1200 1400 1600 1800
Time (s)
2
4
Task 2.4: Acceleration and driving style
Acceleration and Driving Style Classification
6 3
Acceleration
Driving Style 2.5

4 2

1.5

2 1
Acceleration (m/s2 )

0.5

Driving style
0 0

-2

-4

-6
0 200 400 600 800 1000 1200 1400 16002
5 1800
Time (s)
Task 2.5: Battery pack temperature
Temperature Data from Sensors T1, T2, T3 and T4
18
minimum
maximum
16 mean

14

Temperature (°C) 12

10

0
T1 T2 T3 T4
Temperature Sensor Number
2
6

You might also like