How to plot a given signal but by setting a limit on the X value

2 views (last 30 days)
This is for a homework assignment for a class i am taking right now. We are given a signal [S] to download, and the X axis goes to 2000. I have searched for a while for a function that will allow me to plot from [0:200], but i am having no luck so far.

Accepted Answer

Adam
Adam on 8 Dec 2017
doc xlim
will change the axis limits
someArray(1:200)
will allow you to only access the first 200 samples of the array to plot in the first place.

More Answers (1)

David Escobio
David Escobio on 8 Dec 2017
Not the proper syntax, but i got it to work, thank you Adam for steering me in the right direction.
plot(S) xlim ([0 200])
This is what worked if you were wondering

Community Treasure Hunt

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

Start Hunting!