Skip to content

Instantly share code, notes, and snippets.

@GiovanniBalestrieri
Created July 30, 2015 18:36
Show Gist options
  • Save GiovanniBalestrieri/5541ff011e535f3cf4f2 to your computer and use it in GitHub Desktop.
Save GiovanniBalestrieri/5541ff011e535f3cf4f2 to your computer and use it in GitHub Desktop.
Matab Snippet - Saving CSV data from Arduino to Matlab
% wait one second then record
if numberOfSamples==rate*2 && recording
disp('saving samples to file');
gDataToWrite = [gxdata gydata gzdata];
csvwrite('samples.txt',gDataToWrite);
disp('saving file to structure');
dat.x = gxdata;
dat.y = gydata;
dat.z = gzdata;
save('samples.mat','-struct','dat');
disp('Saved.');
finished = true;
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment