Matlab Reading Data Binary
Matlab Reading Data Binary
Course Website:
http://indra.uoregon.edu/~admin/mediawiki-
1.13.4/index.php/Matlab_DIY_for_Beginners
Today's Lesson
Unfamiliar extension?
• Check the documentation
• http://filext.com/ --> File Extension Search
Data encoded in a CSV
Trial,RT,Response,Expected
1,423,1,1
2,547,2,1
3,579,2,2
4,324,2,1
5,446,1,1
Data Encoded in a TSV
commas and white space were used to separate the rows and columns
Data Organization
How is the data presented in the file?
• headers?
• data separators?
o white space
o comma
o tab
• data types?
o numbers?
o letters?
o mixture?
How does Matlab see data?
• data types?
o Numbers?
Integers (whole numbers)
Doubles (decimals included)
o letters?
Characters (letter)
Strings (sequences of letters)
o mixture?
Characters (letter or number)
Strings (sequences of letters and numbers)
o booleans?
True = 1
False = 0
Workspace can help you identify what Matlab sees
csvread subj_01,
23 45 6 male, 34,
7 89 dlmread right
textscan
First Step - Writing your first code
Comments
%This is a comment
This is code
Filename:
data.csv, collection.txt, subject117.tsv
File Path:
On Windows: C:\My Documents\Collection\
On Mac/Unix: /Users/default/Collection/
Declaring File Name and Path
%Path to File
filepath = 'C:\Desktop\Classwork\' ;
Opening that file
%Path to File
filepath = 'C:\Desktop\Classwork\' ;