Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x=-10:10;
- w=input('enter width');
- l=length(x);
- y=ceil(-w/2):(ceil(w/2)-1);
- a=[zeros(1,10-ceil(w/2)),ones(1,length(y)),zeros(1,10-ceil(w/2))];
- plot(x,a)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement