Because the missing data points are probably not the same for every line I advice to plot in a loop like this (assuming plot data are columns of the matrices):
for i = 1 : size(M, 2)
data = M(:, i);
good = not(isnan(data));
xi = x(good);
data = data(good);
error = E(good, i);
errorbar(xi, data, error, 'o-');
hold on;
end