The plot function works only when the input arguments X and Y have identical dimensions.
In your code, when you try to plot ‘x’ and ‘V’ in line 39, the size of x is [1,12002] and size of V is [1,6002], this throws an error.
To plot x vs M, remove the line 39 to line 45, this will work as ‘x’ has same size as ‘M’
Check your code for variables to have identical dimensions before plotting.
Kiran Felix Robert