Skip to content

Instantly share code, notes, and snippets.

@vadixidav
Created November 19, 2015 02:34
Show Gist options
  • Save vadixidav/353ca7bb8806b41ea96b to your computer and use it in GitHub Desktop.
Save vadixidav/353ca7bb8806b41ea96b to your computer and use it in GitHub Desktop.
function drawwave(first,second,duration,firstoffset,firstheight)
hold off;
a = csvread(first);
a(1) = [];
b = csvread(second);
b(1) = [];
mina = min(a);
maxa = max(a);
rangea = maxa - mina;
a = a - mina;
a = a / rangea * firstheight;
b = b - mina;
b = b / rangea * firstheight;
a = a + firstoffset;
b = b + firstoffset;
x = linspace(0,duration,length(a));
plot(x,a,'Color',[1.0,0.0,0.0]);
hold on;
plot(x,b,'Color',[0.0,0.0,1.0]);
set(gca,'FontSize',20);
xlabel('Time (s)','FontSize',20);
ylabel('Voltage (V)','FontSize',20);
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment