You never change ‘epsilon’ in your code, so it remains a single scalar value. You need to create a vector from it if you want to plot with respect to it.
If you want to create a vector from ‘err’, subscript it:
err(iteration) = sum((Y - w'*X).^2); %just to check