I am currently trying to plot a matrix,let's call it 'A' containing NaNs in it, when I use plot(x,A, '-k'), it displays correctly (right image below), with gaps when the data is NaN. However, when I try to plot with just markers plot(x,A,'kx') (left image below), there are data points where there should be gaps (where NaN values are), there seems to be some interpolation going on.
I wonder if this is an issue with the Matlab version I have access on: R2021a - if so, is there any work around this? I tried fishing out the indices of non-NaN values and plotting those instead both for x and A variables but there still seems to be some interpolation. Please help.