Skip to content

Instantly share code, notes, and snippets.

@GiovanniBalestrieri
Created July 28, 2015 02:36
Show Gist options
  • Save GiovanniBalestrieri/85e010a07675d86cb30b to your computer and use it in GitHub Desktop.
Save GiovanniBalestrieri/85e010a07675d86cb30b to your computer and use it in GitHub Desktop.
Snippet 4 - Rolling Plot Matlab Arduino Gyroscope
% Save angular rates from the received CSV string
C = textscan(sentence,'%c %d %d %d %c','delimiter',',');
Wx = C{2};
% update the buffer
gxdata = [ gxdata(2:end) ; Wx ];
% Plot, anzi subPlot!
subplot(3,1,1);
title('X Axis Omega in deg/s');
plot(index,gxdata,'r','LineWidth',2);%,'MarkerEdgeColor','k','MarkerFaceColor','g','MarkerSize',5);
xlabel('Sample');
ylabel('Wx (deg/sec)');
drawnow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment