The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled Matlab Code
Posted by: grady | February 12, 2011 @ 10:41pm
Matlab Code
[
Download
]
close all clear all clc x = inline('upulse(t-0.5,0,0.5,0) - upulse(t,0,0,0.5)'); t = linspace(0,1,1001); xat = -.55*sin(2*pi*t)-0.13*sin(4*pi*t); fs = 5; T = 1/fs; tn = 0.2:T:1; xn = inline('upulse(tn-0.5,0,0.5,0) - upulse(tn,0,0,0.5)'); subplot(121), plot(t, xat,t, x(t), tn, xn(tn), 'o') grid on; xlabel('t (sec)');ylabel('x(t),xa(t)'); title('fs = 5 Hz') % part e xat10 = -.6155*sin(2*pi*t)-0.2753*sin(4*pi*t)-.1453*sin(6*pi*t)-.065*sin(8*pi*t); fs10 = 10; T10 = 1/fs10; tn10 = 0.1:T10:1; xn10 = inline('upulse(tn-0.5,0,0.5,0) - upulse(tn,0,0,0.5)'); subplot(122), plot(t, xat10,t, x(t), tn10, xn10(tn10), 'o') grid on; xlabel('t (sec)');ylabel('x(t),xa(t)'); title('fs = 10 Hz') a = [sin(pi/5) sin(2*pi/5) sin(3*pi/5) sin(4*pi/5); sin(2*pi/5) sin(4*pi/5) sin(6*pi/5) sin(8*pi/5); sin(3*pi/5) sin(6*pi/5) sin(9*pi/5) sin(12*pi/5); sin(4*pi/5) sin(8*pi/5) sin(12*pi/5) sin(16*pi/5)];
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.33 / 8
55 Votes
http://codebin.yi.org/1113
page generated in 0.00 seconds