In: Electrical Engineering
1) Do linear regression (includes line, r-coefficient) for data taken from a thermocouple during calibration for:
Voltage (Volts) |
Temperature (ºC) |
0.032 |
0 |
0.063 |
10 |
0.16 |
25 |
0.29 |
50 |
0.36 |
63 |
0.51 |
75 |
0.63 |
100 |
Hello,
Please find
the answer attached as under. Please give a thumbs up
rating if you find the answer useful! Have a rocking day
ahead!
NOTE: I have used Matlab to do the regression. Please find the code and output below:
Matlab Code:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% linear regression on set of data
Y =
[0.032;0.063;0.16;0.29;0.36;0.51;0.63];
% input data
X = [1 0;1 10;1 25;1 50;1 63;1 75;1 100];
B =
X\Y;
% calculating regression coefficient
clc;
fprintf('The regression coefficient is r = %f\n',B(2));
x = X(:,2);
%%%%%%%%%% Plotting routines
scatter(x,Y)
hold;
plot(x,(B(2)*x)+B(1));
grid;
xlabel('X');
ylabel('Y');
title('Regression plot between X and Y')
**********************
Output: