MATLAB: I have the index value from a plot. Now what

indexplot

Hello,
I have created a plot, any plot will work. Then went in with data cursor function within the plot, right clicked and exported the cursor data. The cursor info, produced a 'DataIndex' value. Say I want the plot to start at the provided index value, how would I go about that?
I am also attempting to create a beginning and end function as I have to use this time interval multiple times.
Example:
Beginning= ____ %the index value, this is where I am not sure how to use the indexed value
End = max(time) %the end of the plot
TimeInterval = (Beginning:End)
plot(load(TimeInterval),deflection(TimeInterval))
Thank you,
Cory

Best Answer

plot(load(TimeInterval),deflection(Beginning:end))
That is, use the same indexing of your y data as you used for your x data. You were attempting to use your x values to index your y values, instead of using the positions to index each of them.