相同长度误差(错误栏绘图matlab)

时间:2016-08-11 16:31:08

标签: matlab plot errorbar

新用户在这里!目前试图绘制由置信区间组成的误差条,并且数据集由先前计算的轮廓(cmatrix)的坐标组成。我收到此错误:

x, y, and errorbars must all be the same length.

midpointPositionMeanmidpointPositionConf95都是由1x8向量组成的4x3矩阵。 midpointPosition是一个3x4矩阵。 StatsonCells计算平均值和置信区间为95%。我需要改变什么?

[midpointPositionMean,midpointPositionConf95]=StatsOnCells(midpointPosition');

errorbar([0.85,1.15,1.45],...
  cell2mat(midpointPositionMean),...
  cell2mat(midpointPositionConf95),...
  'bx');
hold on;
plot(repmat(0.85,size(midpointPosition(1,:))),...
  midpointPosition(1,:),'ob','MarkerFaceColor','b')

plot(repmat(1.15,size(midpointPosition(2,:))),...
  midpointPosition(2,:),'ob','MarkerFaceColor','b')

plot(repmat(1.45,size(midpointPosition(3,:))),...
  midpointPosition(3,:),'ob','MarkerFaceColor','b')

0 个答案:

没有答案