Create a gist now

Instantly share code, notes, and snippets.

@ennerf /loadBenchmarkLog.m Secret
Last active Oct 25, 2016

What would you like to do?
Matlab script for loading binary data into a table (example for a blog post)
file = '<fileName>';
% Read raw values into vector
fileID = fopen(file);
values = fread(fileID, '*uint64', 'ieee-le');
fclose(fileID);
% Map values to corresponding columns
cols = {
'sequence'
't1'
't2'
't3'
't4'
'nanoTime'
'milliTime'
'source'
};
% Convert vector into table rows
nCols = length(cols);
data = table();
for i = 1:nCols
data.(cols{i}) = double(values(i:nCols:end));
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment