MATLAB Answers

0

cut function and plot

Asked by Josefina Ottitsch on 20 Apr 2019
Latest activity Answered by Cris LaPierre
on 20 Apr 2019
hello,
assuming I have the following code and I only want it to plot sin from the 10th value to the 20th value (there are 21 values), how do I do this?
x=0:.1:2
f=sin(x)
plot(f)
thank you for the support!

  0 Comments

Sign in to comment.

1 Answer

Cris LaPierre
Answer by Cris LaPierre
on 20 Apr 2019

plot(f(10:20))
If you would like to understand more, I highly recommend going through MATLAB Onramp. Chapter 5 address how to select subsets of your data.

  0 Comments

Sign in to comment.