第7页PPT习题:
习题描述的是热电偶(thermo couple,简称 TC),随着温度变化输出线性毫伏(mV)信号的函数图像。
1. 找出拟合函数的β0 和 β1;
2. 画出拟合后的图像。
习题代码:
Temp = [20 30 40 50 60];
TC = [0.025 0.035 0.050 0.060 0.080];
fit = polyfit( Temp,TC, 1);
xfit = (Temp(1):0.1:Temp(end));
yfit = fit(1)* xfit + fit(2);
plot(Temp,TC,'ok',xfit,yfit);
legend({'data-point','best-fit'},'Location','northwest');
xlabel('Temperature(\circC)');
ylabel('TC output(mV)');
title('Calibration of TC');
set(gca,'XTic