Create a unitary step entrance with n points

2 views (last 30 days)
How can i create a vector 1*200 with ones in the first 100 numbers and zeros in the rest. I wanna study the outpout response of a system to this entrance. x(n)=u(n)-u(n-1) with n=200 ssamples.

Accepted Answer

Guillaume
Guillaume on 20 Sep 2014
You just concatenate your vector of 100 ones with your vector of 100 zeros:
v = [ones(1, 100) zeros(1, 100)];

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!