cut function and plot

15 次查看(过去 30 天)
Josefina Ottitsch
Josefina Ottitsch 2019-4-20
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!

回答(1 个)

Cris LaPierre
Cris LaPierre 2019-4-20
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.

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by