MATLAB: I keep getting “Index in position 1 is invalid. Array indices must be positive integers or logical values.” error when trying to use the plot function

faqindexplots

Error:
Here is the code:

Best Answer

On line 83 you've defined a variable named plot. You can't call the plot function because of this. Change line 83 and rename and/or clear the variable named plot.