
% This LaTeX was auto-generated from MATLAB code.
% To make changes, update the MATLAB code and republish this document.

\documentclass{article}
\usepackage{graphicx}
\usepackage{color}

\sloppy
\definecolor{lightgray}{gray}{0.5}
\setlength{\parindent}{0pt}

\begin{document}

    
    \begin{verbatim}
% Redovisning: Kalibreringsdata NTC-motstånd

hold off;
% Importera tabellen med uppmätta värden
DATA = importdata('1_1Matpunkter_edit_DOT_DECIMAL.txt')
T = DATA(:, 2);
U_R = DATA(:, 3);
% Plotta U_R som funktion av T
plot(T, U_R, 'or')
xlabel('Spänning U_R'); ylabel('Temperatur °C');  title('Kalibreringsdata för NTC')
grid on; hold on;

% Least Square Method för att hitta koefficienterna
% Inför kolumn av 1:or i T
T = [ones(size(T)), T]
% Beräkna pseudoinvers av T
T = pinv(T);
% Multiplicera T med U_R för att erhålla koefficienterna
koeff = T*U_R
% Plotta linjen med beräknade koefficienter
x = 22:60; plot(x, koeff(2)*x + koeff(1), '-b')

legend('Mätpunkter', 'Anpassade linjen', 'Location', 'southeast')
\end{verbatim}

        \color{lightgray} \begin{verbatim}
DATA =

   1.0e+02 *

                   0   0.242170000000000   0.010490000000000
   0.010000000000000   0.243390000000000   0.010500000000000
   0.020000000000000   0.244910000000000   0.010530000000000
   0.030000000000000   0.246770000000000   0.010560000000000
   0.040000000000000   0.248800000000000   0.010610000000000
   0.050000000000000   0.251010000000000   0.010660000000000
   0.060000000000000   0.253360000000000   0.010700000000000
   0.070000000000000   0.255830000000000   0.010760000000000
   0.080000000000000   0.258310000000000   0.010820000000000
   0.090000000000000   0.260810000000000   0.010880000000000
   0.100000000000000   0.263380000000000   0.010940000000000
   0.110000000000000   0.266030000000000   0.011000000000000
   0.120000000000000   0.268670000000000   0.011060000000000
   0.130000000000000   0.271360000000000   0.011140000000000
   0.140000000000000   0.274030000000000   0.011200000000000
   0.150000000000000   0.276690000000000   0.011260000000000
   0.160000000000000   0.279380000000000   0.011340000000000
   0.170000000000000   0.281990000000000   0.011400000000000
   0.180000000000000   0.284340000000000   0.011450000000000
   0.190000000000000   0.286820000000000   0.011530000000000
   0.200000000000000   0.289540000000000   0.011600000000000
   0.210000000000000   0.292270000000000   0.011660000000000
   0.220000000000000   0.294960000000000   0.011720000000000
   0.230000000000000   0.297630000000000   0.011800000000000
   0.240000000000000   0.300280000000000   0.011870000000000
   0.250000000000000   0.302920000000000   0.011940000000000
   0.260000000000000   0.305610000000000   0.012020000000000
   0.270000000000000   0.308070000000000   0.012080000000000
   0.280000000000000   0.310520000000000   0.012150000000000
   0.290000000000000   0.313190000000000   0.012230000000000
   0.300000000000000   0.315720000000000   0.012300000000000
   0.310000000000000   0.318460000000000   0.012390000000000
   0.320000000000000   0.321090000000000   0.012480000000000
   0.330000000000000   0.323810000000000   0.012570000000000
   0.340000000000000   0.326490000000000   0.012640000000000
   0.350000000000000   0.328980000000000   0.012700000000000
   0.360000000000000   0.331640000000000   0.012780000000000
   0.370000000000000   0.334310000000000   0.012840000000000
   0.380000000000000   0.336960000000000   0.012910000000000
   0.390000000000000   0.339520000000000   0.012990000000000
   0.400000000000000   0.342140000000000   0.013070000000000
   0.410000000000000   0.344740000000000   0.013150000000000
   0.420000000000000   0.347460000000000   0.013250000000000
   0.430000000000000   0.350100000000000   0.013320000000000
   0.440000000000000   0.352690000000000   0.013390000000000
   0.450000000000000   0.355090000000000   0.013460000000000
   0.460000000000000   0.357370000000000   0.013550000000000
   0.470000000000000   0.359760000000000   0.013600000000000
   0.480000000000000   0.362110000000000   0.013670000000000
   0.490000000000000   0.364080000000000   0.013740000000000
   0.500000000000000   0.366050000000000   0.013780000000000
   0.510000000000000   0.368400000000000   0.013890000000000
   0.520000000000000   0.370820000000000   0.013960000000000
   0.530000000000000   0.373260000000000   0.014050000000000
   0.540000000000000   0.375870000000000   0.014140000000000
   0.550000000000000   0.378350000000000   0.014220000000000
   0.560000000000000   0.380680000000000   0.014290000000000
   0.570000000000000   0.383210000000000   0.014360000000000
   0.580000000000000   0.385580000000000   0.014420000000000
   0.590000000000000   0.388120000000000   0.014510000000000
   0.600000000000000   0.390660000000000   0.014570000000000
   0.610000000000000   0.393030000000000   0.014640000000000
   0.620000000000000   0.395070000000000   0.014710000000000
   0.630000000000000   0.397490000000000   0.014790000000000
   0.640000000000000   0.400050000000000   0.014860000000000
   0.650000000000000   0.402460000000000   0.014900000000000
   0.660000000000000   0.404870000000000   0.014980000000000
   0.670000000000000   0.407070000000000   0.015030000000000
   0.680000000000000   0.409260000000000   0.015090000000000
   0.690000000000000   0.411680000000000   0.015170000000000
   0.700000000000000   0.413810000000000   0.015250000000000
   0.710000000000000   0.415970000000000   0.015310000000000
   0.720000000000000   0.418220000000000   0.015380000000000
   0.730000000000000   0.420540000000000   0.015440000000000
   0.740000000000000   0.422770000000000   0.015510000000000
   0.750000000000000   0.425040000000000   0.015570000000000
   0.760000000000000   0.427290000000000   0.015640000000000
   0.770000000000000   0.429440000000000   0.015690000000000
   0.780000000000000   0.431440000000000   0.015750000000000
   0.790000000000000   0.433700000000000   0.015810000000000
   0.800000000000000   0.435940000000000   0.015880000000000
   0.810000000000000   0.438030000000000   0.015940000000000
   0.820000000000000   0.439680000000000   0.016040000000000
   0.830000000000000   0.441470000000000   0.016150000000000
   0.840000000000000   0.443530000000000   0.016230000000000
   0.850000000000000   0.445210000000000   0.016280000000000
   0.860000000000000   0.447410000000000   0.016350000000000
   0.870000000000000   0.449550000000000   0.016400000000000
   0.880000000000000   0.451390000000000   0.016480000000000
   0.890000000000000   0.453660000000000   0.016530000000000
   0.900000000000000   0.455540000000000   0.016600000000000
   0.910000000000000   0.457260000000000   0.016650000000000
   0.920000000000000   0.459070000000000   0.016680000000000
   0.930000000000000   0.461260000000000   0.016740000000000
   0.940000000000000   0.463400000000000   0.016790000000000
   0.950000000000000   0.465110000000000   0.016870000000000
   0.960000000000000   0.467350000000000   0.016940000000000
   0.970000000000000   0.469360000000000   0.016960000000000
   0.980000000000000   0.471000000000000   0.016970000000000
   0.990000000000000   0.472390000000000   0.017090000000000
   1.000000000000000   0.473670000000000   0.017170000000000
   1.010000000000000   0.475200000000000   0.017210000000000
   1.020000000000000   0.475430000000000   0.017260000000000
   1.030000000000000   0.475640000000000   0.017280000000000
   1.040000000000000   0.477770000000000   0.017320000000000
   1.050000000000000   0.480190000000000   0.017460000000000
   1.060000000000000   0.482660000000000   0.017560000000000
   1.070000000000000   0.484810000000000   0.017620000000000
   1.080000000000000   0.486920000000000   0.017720000000000
   1.090000000000000   0.488270000000000   0.017790000000000
   1.100000000000000   0.489760000000000   0.017820000000000
   1.110000000000000   0.491850000000000   0.017850000000000
   1.120000000000000   0.493570000000000   0.017900000000000
   1.130000000000000   0.495190000000000   0.017930000000000
   1.140000000000000   0.496580000000000   0.017980000000000
   1.150000000000000   0.498230000000000   0.018050000000000
   1.160000000000000   0.499680000000000   0.018090000000000
   1.170000000000000   0.501890000000000   0.018150000000000
   1.180000000000000   0.503670000000000   0.018230000000000
   1.190000000000000   0.505560000000000   0.018290000000000
   1.200000000000000   0.507660000000000   0.018330000000000
   1.210000000000000   0.509330000000000   0.018390000000000
   1.220000000000000   0.511220000000000   0.018440000000000
   1.230000000000000   0.512790000000000   0.018460000000000
   1.240000000000000   0.514650000000000   0.018480000000000
   1.250000000000000   0.516300000000000   0.018550000000000
   1.260000000000000   0.518080000000000   0.018630000000000
   1.270000000000000   0.519930000000000   0.018700000000000
   1.280000000000000   0.521970000000000   0.018760000000000
   1.290000000000000   0.523970000000000   0.018800000000000
   1.300000000000000   0.525570000000000   0.018860000000000
   1.310000000000000   0.526770000000000   0.018930000000000
   1.320000000000000   0.528640000000000   0.019000000000000
   1.330000000000000   0.530580000000000   0.019080000000000
   1.340000000000000   0.532460000000000   0.019130000000000
   1.350000000000000   0.533310000000000   0.019150000000000
   1.360000000000000   0.534240000000000   0.019210000000000
   1.370000000000000   0.535710000000000   0.019290000000000
   1.380000000000000   0.537290000000000   0.019290000000000
   1.390000000000000   0.538980000000000   0.019240000000000
   1.400000000000000   0.540780000000000   0.019210000000000
   1.410000000000000   0.542520000000000   0.019250000000000
   1.420000000000000   0.544100000000000   0.019290000000000
   1.430000000000000   0.545980000000000   0.019360000000000
   1.440000000000000   0.547270000000000   0.019430000000000
   1.450000000000000   0.548760000000000   0.019440000000000
   1.460000000000000   0.550490000000000   0.019480000000000
   1.470000000000000   0.552200000000000   0.019560000000000
   1.480000000000000   0.553820000000000   0.019630000000000
   1.490000000000000   0.555200000000000   0.019700000000000
   1.500000000000000   0.556620000000000   0.019760000000000
   1.510000000000000   0.558200000000000   0.019810000000000
   1.520000000000000   0.559070000000000   0.019870000000000
   1.530000000000000   0.560250000000000   0.019970000000000
   1.540000000000000   0.561620000000000   0.020030000000000
   1.550000000000000   0.563610000000000   0.020070000000000
   1.560000000000000   0.565360000000000   0.020130000000000
   1.570000000000000   0.567190000000000   0.020130000000000
   1.580000000000000   0.568800000000000   0.020160000000000
   1.590000000000000   0.570160000000000   0.020210000000000
   1.600000000000000   0.571800000000000   0.020290000000000
   1.610000000000000   0.573440000000000   0.020330000000000
   1.620000000000000   0.575240000000000   0.020380000000000
   1.630000000000000   0.576960000000000   0.020410000000000
   1.640000000000000   0.578450000000000   0.020450000000000
   1.650000000000000   0.579550000000000   0.020500000000000
   1.660000000000000   0.580640000000000   0.020520000000000
   1.670000000000000   0.581890000000000   0.020550000000000
   1.680000000000000   0.582930000000000   0.020570000000000
   1.690000000000000   0.584440000000000   0.020610000000000
   1.700000000000000   0.585690000000000   0.020650000000000
   1.710000000000000   0.586980000000000   0.020720000000000
   1.720000000000000   0.587800000000000   0.020760000000000
   1.730000000000000   0.588290000000000   0.020860000000000
   1.740000000000000   0.589170000000000   0.020930000000000
   1.750000000000000   0.590260000000000   0.021010000000000
   1.760000000000000   0.591510000000000   0.021060000000000
   1.770000000000000   0.593070000000000   0.021040000000000
   1.780000000000000   0.594830000000000   0.021050000000000
   1.790000000000000   0.596370000000000   0.020990000000000
   1.800000000000000   0.597420000000000   0.021040000000000
   1.810000000000000   0.598640000000000   0.021140000000000
   1.820000000000000   0.599880000000000   0.021210000000000


T =

   1.000000000000000  24.216999999999999
   1.000000000000000  24.338999999999999
   1.000000000000000  24.491000000000000
   1.000000000000000  24.677000000000000
   1.000000000000000  24.879999999999999
   1.000000000000000  25.100999999999999
   1.000000000000000  25.335999999999999
   1.000000000000000  25.582999999999998
   1.000000000000000  25.831000000000000
   1.000000000000000  26.081000000000000
   1.000000000000000  26.338000000000001
   1.000000000000000  26.603000000000002
   1.000000000000000  26.867000000000001
   1.000000000000000  27.135999999999999
   1.000000000000000  27.402999999999999
   1.000000000000000  27.669000000000000
   1.000000000000000  27.937999999999999
   1.000000000000000  28.199000000000002
   1.000000000000000  28.434000000000001
   1.000000000000000  28.681999999999999
   1.000000000000000  28.954000000000001
   1.000000000000000  29.227000000000000
   1.000000000000000  29.495999999999999
   1.000000000000000  29.763000000000002
   1.000000000000000  30.027999999999999
   1.000000000000000  30.292000000000002
   1.000000000000000  30.561000000000000
   1.000000000000000  30.806999999999999
   1.000000000000000  31.052000000000000
   1.000000000000000  31.318999999999999
   1.000000000000000  31.571999999999999
   1.000000000000000  31.846000000000000
   1.000000000000000  32.109000000000002
   1.000000000000000  32.381000000000000
   1.000000000000000  32.649000000000001
   1.000000000000000  32.898000000000003
   1.000000000000000  33.164000000000001
   1.000000000000000  33.430999999999997
   1.000000000000000  33.695999999999998
   1.000000000000000  33.951999999999998
   1.000000000000000  34.213999999999999
   1.000000000000000  34.473999999999997
   1.000000000000000  34.746000000000002
   1.000000000000000  35.009999999999998
   1.000000000000000  35.268999999999998
   1.000000000000000  35.509000000000000
   1.000000000000000  35.737000000000002
   1.000000000000000  35.975999999999999
   1.000000000000000  36.210999999999999
   1.000000000000000  36.408000000000001
   1.000000000000000  36.604999999999997
   1.000000000000000  36.840000000000003
   1.000000000000000  37.082000000000001
   1.000000000000000  37.326000000000001
   1.000000000000000  37.587000000000003
   1.000000000000000  37.835000000000001
   1.000000000000000  38.067999999999998
   1.000000000000000  38.320999999999998
   1.000000000000000  38.558000000000000
   1.000000000000000  38.811999999999998
   1.000000000000000  39.066000000000003
   1.000000000000000  39.302999999999997
   1.000000000000000  39.506999999999998
   1.000000000000000  39.749000000000002
   1.000000000000000  40.005000000000003
   1.000000000000000  40.246000000000002
   1.000000000000000  40.487000000000002
   1.000000000000000  40.707000000000001
   1.000000000000000  40.926000000000002
   1.000000000000000  41.167999999999999
   1.000000000000000  41.381000000000000
   1.000000000000000  41.597000000000001
   1.000000000000000  41.822000000000003
   1.000000000000000  42.054000000000002
   1.000000000000000  42.277000000000001
   1.000000000000000  42.503999999999998
   1.000000000000000  42.728999999999999
   1.000000000000000  42.944000000000003
   1.000000000000000  43.143999999999998
   1.000000000000000  43.369999999999997
   1.000000000000000  43.594000000000001
   1.000000000000000  43.802999999999997
   1.000000000000000  43.968000000000004
   1.000000000000000  44.146999999999998
   1.000000000000000  44.353000000000002
   1.000000000000000  44.521000000000001
   1.000000000000000  44.741000000000000
   1.000000000000000  44.954999999999998
   1.000000000000000  45.139000000000003
   1.000000000000000  45.366000000000000
   1.000000000000000  45.554000000000002
   1.000000000000000  45.725999999999999
   1.000000000000000  45.906999999999996
   1.000000000000000  46.125999999999998
   1.000000000000000  46.340000000000003
   1.000000000000000  46.511000000000003
   1.000000000000000  46.734999999999999
   1.000000000000000  46.936000000000000
   1.000000000000000  47.100000000000001
   1.000000000000000  47.238999999999997
   1.000000000000000  47.366999999999997
   1.000000000000000  47.520000000000003
   1.000000000000000  47.542999999999999
   1.000000000000000  47.564000000000000
   1.000000000000000  47.777000000000001
   1.000000000000000  48.018999999999998
   1.000000000000000  48.265999999999998
   1.000000000000000  48.481000000000002
   1.000000000000000  48.692000000000000
   1.000000000000000  48.826999999999998
   1.000000000000000  48.975999999999999
   1.000000000000000  49.185000000000002
   1.000000000000000  49.356999999999999
   1.000000000000000  49.518999999999998
   1.000000000000000  49.658000000000001
   1.000000000000000  49.823000000000000
   1.000000000000000  49.968000000000004
   1.000000000000000  50.189000000000000
   1.000000000000000  50.366999999999997
   1.000000000000000  50.555999999999997
   1.000000000000000  50.765999999999998
   1.000000000000000  50.933000000000000
   1.000000000000000  51.122000000000000
   1.000000000000000  51.279000000000003
   1.000000000000000  51.465000000000003
   1.000000000000000  51.630000000000003
   1.000000000000000  51.808000000000000
   1.000000000000000  51.993000000000002
   1.000000000000000  52.197000000000003
   1.000000000000000  52.396999999999998
   1.000000000000000  52.557000000000002
   1.000000000000000  52.677000000000000
   1.000000000000000  52.863999999999997
   1.000000000000000  53.058000000000000
   1.000000000000000  53.246000000000002
   1.000000000000000  53.331000000000003
   1.000000000000000  53.423999999999999
   1.000000000000000  53.570999999999998
   1.000000000000000  53.728999999999999
   1.000000000000000  53.898000000000003
   1.000000000000000  54.078000000000003
   1.000000000000000  54.252000000000002
   1.000000000000000  54.409999999999997
   1.000000000000000  54.597999999999999
   1.000000000000000  54.726999999999997
   1.000000000000000  54.875999999999998
   1.000000000000000  55.048999999999999
   1.000000000000000  55.219999999999999
   1.000000000000000  55.381999999999998
   1.000000000000000  55.520000000000003
   1.000000000000000  55.661999999999999
   1.000000000000000  55.820000000000000
   1.000000000000000  55.906999999999996
   1.000000000000000  56.024999999999999
   1.000000000000000  56.161999999999999
   1.000000000000000  56.360999999999997
   1.000000000000000  56.536000000000001
   1.000000000000000  56.719000000000001
   1.000000000000000  56.880000000000003
   1.000000000000000  57.015999999999998
   1.000000000000000  57.180000000000000
   1.000000000000000  57.344000000000001
   1.000000000000000  57.524000000000001
   1.000000000000000  57.695999999999998
   1.000000000000000  57.844999999999999
   1.000000000000000  57.954999999999998
   1.000000000000000  58.064000000000000
   1.000000000000000  58.189000000000000
   1.000000000000000  58.292999999999999
   1.000000000000000  58.444000000000003
   1.000000000000000  58.569000000000003
   1.000000000000000  58.698000000000000
   1.000000000000000  58.780000000000001
   1.000000000000000  58.829000000000001
   1.000000000000000  58.917000000000002
   1.000000000000000  59.026000000000003
   1.000000000000000  59.151000000000003
   1.000000000000000  59.307000000000002
   1.000000000000000  59.482999999999997
   1.000000000000000  59.637000000000000
   1.000000000000000  59.741999999999997
   1.000000000000000  59.863999999999997
   1.000000000000000  59.988000000000000


koeff =

   0.267739393611798
   0.030698099645259

\end{verbatim} \color{black}
    
\includegraphics [width=4in]{URvsT_01.eps}



\end{document}
    
