Created
November 19, 2015 02:34
-
-
Save vadixidav/353ca7bb8806b41ea96b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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