MATLAB: Plot a a matrix by columns but with a different marker for the data at its end

markersMATLABmatrixplotting

I am trying to plot a set of data by introducing the following command
plot11=errorbar(matsizered',matsigmasred',materrred','d','MarkerSize',5)
set(gca,'XScale','log');
xlabel('L/l_e')
ylabel('\sigma_{extinction}')
set(plot11, {'MarkerFaceColor'}, get(plot11,'Color'))
Where matsizered,matsigmasred,materrred are 5×6 matrixes. By doing so, I get the following figure
The question is, can I have the 5 points are the right with an X marker while the other points are still represented by a diamond marker? Thank you very much

Best Answer

figure
hold on % we need this so that successive plotting commands don't overwrite the previous ones
% only plot error bars for the first 5 columns of your matrices
plot11=errorbar(matsizered(:,1:5)',matsigmasred(:,1:5)',materrred(:,1:5)','d','MarkerSize',5)
hax = gca; % current axis handle
hax.ColorOrderIndex=1; % re-set color order for current axis
% plot the remaining error bars individually in order to get the right colors
for j = 1:5
errorbar(matsizered(j,6),matsigmasred(j,6),materrred(j,6),'x','MarkerSize',5)
end
set(plot11, {'MarkerFaceColor'}, get(plot11,'Color'))
set(gca,'XScale','log');
xlabel('L/l_e')
ylabel('\sigma_{extinction}')