Matlab 如何在同一图表上绘制具有平均值和标准偏差的三次拟合?

Matlab 如何在同一图表上绘制具有平均值和标准偏差的三次拟合?,matlab,mean,standard-deviation,cubic-spline,Matlab,Mean,Standard Deviation,Cubic Spline,我试图在同一张图上绘制平均值、标准偏差和三次拟合。目前,我使用“errorbar”函数来绘制平均值和标准偏差。我使用拟合函数对数据进行立方拟合。如何在一个图形中显示所有信息 这是我的密码 为了适应数据: f = fit(x_label',m','cubicinterp'); 绘制拟合数据的步骤 figure plot(f,x_label,m); 绘制平均值和std数据 errorbar(x_label,m,exp_std,'r-'); 你能提供你所拥有的示例代码吗?刚刚解决了它。非常感谢@

我试图在同一张图上绘制平均值、标准偏差和三次拟合。目前,我使用“errorbar”函数来绘制平均值和标准偏差。我使用拟合函数对数据进行立方拟合。如何在一个图形中显示所有信息

这是我的密码

为了适应数据:

f = fit(x_label',m','cubicinterp');
绘制拟合数据的步骤

figure
plot(f,x_label,m);
绘制平均值和std数据

errorbar(x_label,m,exp_std,'r-');

你能提供你所拥有的示例代码吗?刚刚解决了它。非常感谢@Marcin
f = fit(x_label',m','cubicinterp');  %fit the data
plot(f,'b');                         %plot the fitting curve
hold on                              %hold the current graph
errorbar(x_label',m',exp_std','rx');  %plot the mean and standard deviation