Advertisement
tsnaik

Square signal

Oct 22nd, 2014
360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.15 KB | None | 0 0
  1. x=-10:10;
  2. w=input('enter width');
  3. l=length(x);
  4. y=ceil(-w/2):(ceil(w/2)-1);
  5. a=[zeros(1,10-ceil(w/2)),ones(1,length(y)),zeros(1,10-ceil(w/2))];
  6. plot(x,a)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement