2016-09-09 3 views
1

Angenommen, ich habe den folgenden Vektor bekam und zeichnen es aus dem Index 1 bis 11:Wie kann ich einen Teil eines einfachen Vektors darstellen?

a = [1 2 5 4 5 4 2 3 7 1 5]; 
plot(a); 

Wie kann ich nur einen Teil dieses Vektors plotten? wie von Index 3 bis Index 7. Ich fand this question aber konnte nicht herausfinden, wie man es benutzt.

+0

https://www.mathworks.com/matlabcentral/answers/62838-how-to-plot-portion-of-a-vector-in-matlab?requestedDomain=www.mathworks.com – CiucaS

Antwort

1
a = [1 2 5 4 5 4 2 3 7 1 5]; 
plot(a(3:7)); 
Verwandte Themen