Good question. I also faced this issue a few years ago, and I found the simplest solution was to append NaN onto the bottom of the matrices, e.g.:
X(end+1,:) = NaN;
Y(end+1,:) = NaN;
plot(X,Y,'-o')
This forces MATLAB to treat each column as its own "line", even if it contains only one data point, while the NaNs are of course not plotted (so you do not need a special case, the NaNs can be appended to matrices of any size). Here is an example with your data:
>> X = [1,1.1];
>> Y = [3,3.5];
>> X(end+1,:) = NaN;
>> Y(end+1,:) = NaN;
>> plot(X,Y,'-o')
Best Answer