MATLAB: Indexing into an Array in a For Loop is Off by 1

indexingMATLAB

I am trying to index these values into the array for plotting but my results and my plot are off by one value?

Best Answer

Absolutely guessing here. Perhaps it is because your ‘x’ value begins at 0?
Array indices in MATLAB are integers greater than 0.