Hi, I have this data:
PPdata = [960.6 960.3 960.4; 960.5 960.7 960.7];PPerr = [0.4 0.4 0.5; 0.1 0.1 0.1];PPx=categorical({'\it CL','\it DM'});
And I have to create a bar plot with error bars, I am using this code and it works for creating the bar plot
figurebar(PPx,PPdata)hold ontitle('Peak position by region')ylim([960.2 961.2]);legend({'Cervical','Cuspal','Intercuspal'},'Location','southoutside')
But when I want to add the error bars (PPerr = [0.4 0.4 0.5; 0.1 0.1 0.1]), using:
errorbar(PPx,PPdata,PPerr);
this happens:
Error using errorbar>checkSingleInput (line 270)
XData must be the same size as YData.
And when I use:
errorbar(PPdata,PPerr);
This is the plot that appears:
What can I do?
Best Answer