【发布时间】:2019-01-18 04:48:46
【问题描述】:
我在 y 轴(偏航率)上有一个信号,在 x 轴(时间)上有一个时间信号。我试图找到这个信号的置信区间。但我无法绘制信号的平均值。我认为因为平均值有 2 个向量,但信号大小为 5001。我该如何解决?我感谢您的回答!
N = size(yawrate,1); % Number of ‘Experiments’ In Data Set
yMean = mean(yawrate); % Mean Of All Experiments At Each Value Of ‘time’`
ySEM = std(yawrate)/sqrt(N); % Compute ‘Standard Error Of The Mean’ Of All Experiments At Each Value Of ‘time’
CI95 = tinv([0.025 0.975], N-1); % t-score Calculate 95% Probability Intervals Of t-Distribution
yCI95 = bsxfun(@times, ySEM, CI95(:)); % Calculate 95% Confidence Intervals Of All Experiments At Each Value Of ‘x’
figure
plot(time, yMean) % Plot Mean Of All Experiments
hold on
plot(time, yCI95+yMean) % Plot 95% Confidence Intervals Of All Experiments
hold off
grid
【问题讨论】:
-
yawrate和time的大小是多少? “平均值有 2 个向量”是什么意思? -
非常感谢您的回答。偏航率和时间的大小是 5001。我的意思是平均值的大小显示 1 1。
-
代码是为
yawrate编写的,它是一个NxM矩阵,具有M时间步和N实验。在这种情况下,mean(yawrate)是一个具有M值的向量。time也需要有M值。如果你的N为 1,则这段代码没有用。 -
不,我的 N 是 5001。
-
不,你的
M是 5001,你的N是 1。
标签: matlab plot mean confidence-interval