Newbie_01
Newbie_01

Reputation: 61

The point to begin the plot from

I have a rather simple question. If I have a set of data A for the y axis with data from 0 to 100 in one column, and the same with the x-axis (time from 0 to 100), how can I plot the graph if I want to begin to plot the data from 20 to 100 (rather than 0 to 100)?

I hope that I made it clear. Thanks!

Upvotes: 0

Views: 22

Answers (1)

NLindros
NLindros

Reputation: 1693

Use indexes to point out a specific part of a vector or matrix. Assuming that the x-data is in the first column of A and y-data in the 2nd.

startIdx = 20;
plot( A(startIdx:end, 1), A(startIdx:end, 2) ); 

Upvotes: 2

Related Questions