每个测量值的特定时间点的 Matlab 条形图

Matlab bar plot in specific time points of each measured values

我想绘制与特定时间点获得的值相对应的垂直线。

示例:

a = [0    5  7    9 ] at 0 seconds, 
b = [0.5  6  6.5  11] at 2 seconds,
c = [0    4  2    10] at 4 seconds

每个时间点都是向量的最大值和最小值之间的垂直线。我还需要标记 abc 的起点和终点,例如 a 应该在 0 和 9 处有一个圆(或星等) .

这是一个示例输出:

您可以使用带有结束标记的 line

% Your data
a = [0    5   7    9 ];
b = [0.5  6   6.5  11];
c = [0    4   2    10];
% Combine to get min/max values
data = [a; b; c].';
mins = min(data);
maxs = max(data);
% Plot using line, nice flexible method which plots vertical lines at points 2:2:n 
line(repmat(2*(0:numel(mins)-1), 2, 1), [mins; maxs], 'color', 'k', 'marker', 'o')

输出:


如果您想要在每一端使用不同的标记或不同的颜色,请参阅 ,其中提供了更详细的示例。