load lecture4 TempExactFun TempExactFun = function_handle with value: @(time)14.6*exp(-1.1*time) TempMeasured TempMeasured = 15 8 5 3 2 try1 TempExactFun = function_handle with value: @(time)14.6*exp(-1.1*time) TempMeasured = 15 8 5 3 2 timeMeasured timeMeasured = Columns 1 through 4 0 0.5000 1.0000 1.5000 Column 5 2.0000 try1 timeMeasured = Columns 1 through 4 0 0.5000 1.0000 1.5000 Column 5 2.0000 try1 CoefLinFit = -6.2000 12.8000 try1 time = 0.7000 exact = 6.7600 try1 time = 0.7000 exact = 6.7600 TempLinFit = 8.4600 try1 {Struct contents reference from a non-struct array object. Error in try1 (line 10) TempLinFitPlot=polyval(CoefLinFit.timePlot);} try1 try1 try2 {Undefined function or variable 'Quadspace'. Error in try2 (line 8) timePlot=Quadspace(0,2,200);} try2 try4 try4 try4 try4 time = 5 exact = 0.0597 TempQuarticFit = 395.0000 try1 timeMeasured = Columns 1 through 5 0 0.0500 0.1000 0.1500 0.2000 Columns 6 through 10 0.2500 0.3000 0.3500 0.4000 0.4500 Columns 11 through 15 0.5000 0.5500 0.6000 0.6500 0.7000 Columns 16 through 20 0.7500 0.8000 0.8500 0.9000 0.9500 Columns 21 through 25 1.0000 1.0500 1.1000 1.1500 1.2000 Columns 26 through 30 1.2500 1.3000 1.3500 1.4000 1.4500 Columns 31 through 35 1.5000 1.5500 1.6000 1.6500 1.7000 Columns 36 through 40 1.7500 1.8000 1.8500 1.9000 1.9500 Column 41 2.0000 TempMeasured = Columns 1 through 9 15 14 13 12 12 11 10 10 9 Columns 10 through 18 9 8 8 8 7 7 6 6 6 Columns 19 through 27 5 5 5 5 4 4 4 4 3 Columns 28 through 36 3 3 3 3 3 3 2 2 2 Columns 37 through 41 2 2 2 2 2 try1 exact = 6.7600 TempLinFit = 7.7470 try4 time = 0.7000 exact = 6.7600 TempQuarticFit = 6.6952 time = 5 exact = 0.0597 TempQuarticFit = 259.5908 tryint time = 0.7000 exact = 6.7600 {Undefined function or variable 'Tempmeasured'. Error in tryint (line 6) TempLinear=interp1(timeMeasured,Tempmeasured,time)} tryint time = 0.7000 exact = 6.7600 {Undefined function or variable 'Tempmeasured'. Error in tryint (line 6) TempLinear=interp1(timeMeasured,Tempmeasured,time)} tryint time = 0.7000 exact = 6.7600 TempLinear = 7 TempSpline = 7 time = 5 exact = 0.0597 TempLinear = NaN TempSpline = 108.4746 TempLinearPlot = Columns 1 through 7 15.0000 14.7990 14.5980 14.3970 14.1960 13.9950 13.7940 Columns 8 through 14 13.5930 13.3920 13.1910 12.9899 12.7889 12.5879 12.3869 Columns 15 through 21 12.1859 12.0000 12.0000 12.0000 12.0000 12.0000 11.9799 Columns 22 through 28 11.7789 11.5779 11.3769 11.1759 10.9749 10.7739 10.5729 Columns 29 through 35 10.3719 10.1709 10.0000 10.0000 10.0000 10.0000 10.0000 Columns 36 through 42 9.9648 9.7638 9.5628 9.3618 9.1608 9.0000 9.0000 Columns 43 through 49 9.0000 9.0000 9.0000 8.9548 8.7538 8.5528 8.3518 Columns 50 through 56 8.1508 8.0000 8.0000 8.0000 8.0000 8.0000 8.0000 Columns 57 through 63 8.0000 8.0000 8.0000 8.0000 7.9397 7.7387 7.5377 Columns 64 through 70 7.3367 7.1357 7.0000 7.0000 7.0000 7.0000 7.0000 Columns 71 through 77 6.9296 6.7286 6.5276 6.3266 6.1256 6.0000 6.0000 Columns 78 through 84 6.0000 6.0000 6.0000 6.0000 6.0000 6.0000 6.0000 Columns 85 through 91 6.0000 5.9146 5.7136 5.5126 5.3116 5.1106 5.0000 Columns 92 through 98 5.0000 5.0000 5.0000 5.0000 5.0000 5.0000 5.0000 Columns 99 through 105 5.0000 5.0000 5.0000 5.0000 5.0000 5.0000 5.0000 Columns 106 through 112 4.8945 4.6935 4.4925 4.2915 4.0905 4.0000 4.0000 Columns 113 through 119 4.0000 4.0000 4.0000 4.0000 4.0000 4.0000 4.0000 Columns 120 through 126 4.0000 4.0000 4.0000 4.0000 4.0000 4.0000 3.8744 Columns 127 through 133 3.6734 3.4724 3.2714 3.0704 3.0000 3.0000 3.0000 Columns 134 through 140 3.0000 3.0000 3.0000 3.0000 3.0000 3.0000 3.0000 Columns 141 through 147 3.0000 3.0000 3.0000 3.0000 3.0000 3.0000 3.0000 Columns 148 through 154 3.0000 3.0000 3.0000 3.0000 3.0000 3.0000 3.0000 Columns 155 through 161 3.0000 3.0000 3.0000 3.0000 3.0000 3.0000 2.8392 Columns 162 through 168 2.6382 2.4372 2.2362 2.0352 2.0000 2.0000 2.0000 Columns 169 through 175 2.0000 2.0000 2.0000 2.0000 2.0000 2.0000 2.0000 Columns 176 through 182 2.0000 2.0000 2.0000 2.0000 2.0000 2.0000 2.0000 Columns 183 through 189 2.0000 2.0000 2.0000 2.0000 2.0000 2.0000 2.0000 Columns 190 through 196 2.0000 2.0000 2.0000 2.0000 2.0000 2.0000 2.0000 Columns 197 through 200 2.0000 2.0000 2.0000 2.0000 TempSplinePlot = Columns 1 through 7 15.0000 14.7732 14.5637 14.3672 14.1792 13.9954 13.8116 Columns 8 through 14 13.6232 13.4261 13.2159 12.9881 12.7436 12.5002 12.2798 Columns 15 through 21 12.1040 11.9946 11.9617 11.9790 12.0125 12.0285 11.9932 Columns 22 through 28 11.8838 11.7103 11.4888 11.2354 10.9660 10.6974 10.4475 Columns 29 through 35 10.2345 10.0769 9.9928 9.9856 10.0210 10.0586 10.0580 Columns 36 through 42 9.9787 9.8036 9.5704 9.3252 9.1138 8.9822 8.9501 Columns 43 through 49 8.9794 9.0243 9.0389 8.9772 8.8195 8.5992 8.3567 Columns 50 through 56 8.1322 7.9660 7.8799 7.8600 7.8887 7.9480 8.0201 Columns 57 through 63 8.0872 8.1317 8.1358 8.0818 7.9523 7.7500 7.5114 Columns 64 through 70 7.2763 7.0847 6.9759 6.9586 6.9927 7.0341 7.0382 Columns 71 through 77 6.9615 6.7923 6.5668 6.3249 6.1067 5.9515 5.8757 Columns 78 through 84 5.8636 5.8970 5.9579 6.0281 6.0903 6.1282 6.1256 Columns 85 through 91 6.0662 5.9344 5.7365 5.5051 5.2748 5.0797 4.9536 Columns 92 through 98 4.9037 4.9079 4.9426 4.9838 5.0084 5.0099 4.9995 Columns 99 through 105 4.9891 4.9908 5.0159 5.0583 5.0942 5.0996 5.0499 Columns 106 through 112 4.9224 4.7243 4.4910 4.2591 4.0652 3.9440 3.8993 Columns 113 through 119 3.9079 3.9451 3.9869 4.0099 4.0100 3.9990 3.9891 Columns 120 through 126 3.9923 4.0195 4.0620 4.0958 4.0968 4.0407 3.9057 Columns 127 through 133 3.7034 3.4692 3.2394 3.0501 2.9345 2.8929 2.9031 Columns 134 through 140 2.9422 2.9877 3.0182 3.0291 3.0263 3.0156 3.0032 Columns 141 through 147 2.9945 2.9909 2.9911 2.9941 2.9987 3.0035 3.0075 Columns 148 through 154 3.0094 3.0080 3.0023 2.9914 2.9791 2.9713 2.9739 Columns 155 through 161 2.9929 3.0320 3.0771 3.1059 3.0956 3.0238 2.8727 Columns 162 through 168 2.6615 2.4258 2.2013 2.0236 1.9230 1.8923 1.9091 Columns 169 through 175 1.9507 1.9946 2.0211 2.0289 2.0241 2.0129 2.0012 Columns 176 through 182 1.9943 1.9923 1.9936 1.9966 1.9997 2.0016 2.0021 Columns 183 through 189 2.0017 2.0009 2.0001 1.9996 1.9994 1.9995 1.9998 Columns 190 through 196 2.0000 2.0001 2.0002 2.0002 2.0001 2.0000 1.9999 Columns 197 through 200 1.9998 1.9998 1.9999 2.0000 tryint time = 0.7000 exact = 6.7600 TempLinear = 7 TempSpline = 7 time = 5 exact = 0.0597 TempLinear = NaN TempSpline = 108.4746 tryint time = 0.7000 exact = 6.7600 TempLinear = 7 TempSpline = 7 time = 5 exact = 0.0597 {Error using interp1>parseinputs (line 373) Invalid character vector argument. Did you mean 'pp' or 'extrap'? Error in interp1 (line 77) [method,extrapval,ndataarg,pp] = parseinputs(varargin{:}); Error in tryint (line 10) TempLinear=interp1(timeMeasured,TempMeasured,time,'extrap','linear')} tryint time = 0.7000 exact = 6.7600 TempLinear = 7 TempSpline = 7 time = 5 exact = 0.0597 TempLinear = 2 TempSpline = 108.4746 try4 time = 0.7000 exact = 6.7600 TempQuarticFit = 6.6952 time = 5 exact = 0.0597 TempQuarticFit = 259.5908 error = 0.3746 try4 time = 0.7000 exact = 6.7600 TempQuarticFit = 6.6952 time = 5 exact = 0.0597 TempQuarticFit = 259.5908 errorMax = 0.3746 errorAve = 0.3359 try4 time = 0.7000 exact = 6.7600 TempQuarticFit = 6.6952 time = 5 exact = 0.0597 TempQuarticFit = 259.5908 errorMax = 0.3746 errorAve = 0.3359 errorRMS = Columns 1 through 7 0.0362 0.0328 0.0295 0.0263 0.0233 0.0204 0.0176 Columns 8 through 14 0.0149 0.0123 0.0099 0.0076 0.0054 0.0033 0.0013 Columns 15 through 21 0.0006 0.0024 0.0041 0.0057 0.0072 0.0087 0.0100 Columns 22 through 28 0.0112 0.0124 0.0135 0.0145 0.0154 0.0162 0.0170 Columns 29 through 35 0.0177 0.0183 0.0189 0.0194 0.0199 0.0202 0.0206 Columns 36 through 42 0.0209 0.0211 0.0212 0.0214 0.0214 0.0215 0.0214 Columns 43 through 49 0.0214 0.0213 0.0212 0.0210 0.0208 0.0205 0.0203 Columns 50 through 56 0.0200 0.0197 0.0193 0.0189 0.0185 0.0181 0.0177 Columns 57 through 63 0.0172 0.0168 0.0163 0.0158 0.0153 0.0148 0.0143 Columns 64 through 70 0.0137 0.0132 0.0127 0.0121 0.0116 0.0110 0.0105 Columns 71 through 77 0.0099 0.0094 0.0088 0.0083 0.0078 0.0072 0.0067 Columns 78 through 84 0.0062 0.0057 0.0052 0.0047 0.0043 0.0038 0.0034 Columns 85 through 91 0.0029 0.0025 0.0021 0.0017 0.0014 0.0010 0.0007 Columns 92 through 98 0.0003 0.0000 0.0003 0.0005 0.0008 0.0010 0.0012 Columns 99 through 105 0.0014 0.0016 0.0017 0.0019 0.0020 0.0021 0.0021 Columns 106 through 112 0.0022 0.0022 0.0022 0.0022 0.0022 0.0022 0.0021 Columns 113 through 119 0.0020 0.0019 0.0018 0.0017 0.0015 0.0014 0.0012 Columns 120 through 126 0.0010 0.0008 0.0005 0.0003 0.0001 0.0002 0.0005 Columns 127 through 133 0.0008 0.0011 0.0014 0.0017 0.0020 0.0023 0.0026 Columns 134 through 140 0.0029 0.0033 0.0036 0.0039 0.0043 0.0046 0.0049 Columns 141 through 147 0.0052 0.0055 0.0058 0.0061 0.0064 0.0066 0.0069 Columns 148 through 154 0.0071 0.0073 0.0075 0.0077 0.0079 0.0080 0.0081 Columns 155 through 161 0.0081 0.0082 0.0082 0.0082 0.0081 0.0080 0.0078 Columns 162 through 168 0.0076 0.0074 0.0071 0.0068 0.0064 0.0059 0.0054 Columns 169 through 175 0.0048 0.0042 0.0035 0.0027 0.0019 0.0010 0.0000 Columns 176 through 182 0.0011 0.0022 0.0034 0.0048 0.0062 0.0077 0.0093 Columns 183 through 189 0.0110 0.0128 0.0147 0.0167 0.0189 0.0211 0.0235 Columns 190 through 196 0.0260 0.0286 0.0314 0.0342 0.0373 0.0404 0.0437 Columns 197 through 200 0.0472 0.0508 0.0546 0.0585 try4 time = 0.7000 exact = 6.7600 TempQuarticFit = 6.6952 time = 5 exact = 0.0597 TempQuarticFit = 259.5908 errorMax = 0.3746 errorAve = 0.3359 {Error using ^ One argument must be a square matrix and the other must be a scalar. Use POWER (.^) for elementwise power. Error in try4 (line 19) errorRMS=sqrt(abs(TempQuarticFitPlot-TempExactPlot)^2/41)} try4 time = 0.7000 exact = 6.7600 TempQuarticFit = 6.6952 time = 5 exact = 0.0597 TempQuarticFit = 259.5908 errorMax = 0.3746 errorAve = 0.3359 errorRMS = 0.2150 sigma=5.67E-8 sigma = 5.6700e-08 T0=273.15 T0 = 273.1500 qExact=integral(@(time) (TempExactFun(time)+T0).^4,0,2)*sigma*60 qExact = 4.1299e+04 qExact=integral(@(time) (polyval(CoefQuartFit,time))+T0).^4,0,2)*sigma*60 qExact=integral(@(time) (polyval(CoefQuartFit,time))+T0).^4,0,2)*sigma*60  {Error: Unbalanced or unexpected parenthesis or bracket. } qExact=integral(@(time) (polyval(CoefQuartFit,time)+T0).^4,0,2)*sigma*60 {Undefined function or variable 'CoefQuartFit'. Error in @(time)(polyval(CoefQuartFit,time)+T0).^4 Error in integralCalc/iterateScalarValued (line 314) fx = FUN(t); Error in integralCalc/vadapt (line 132) [q,errbnd] = iterateScalarValued(u,tinterval,pathlen); Error in integralCalc (line 75) [q,errbnd] = vadapt(@AtoBInvTransform,interval); Error in integral (line 88) Q = integralCalc(fun,a,b,opstruct);} qExact=integral(@(time) (polyval(CoefQuarticFit,time)+T0).^4,0,2)*sigma*60 qExact = 4.1290e+04 qExact=integral(@(time) (polyval(CoefQuartFit,time))+T0).^4,0,2)*sigma*60 qExact=integral(@(time) (polyval(CoefQuartFit,time))+T0).^4,0,2)*sigma*60  {Error: Unbalanced or unexpected parenthesis or bracket. } qExact=integral(@(time) (TempExactFun(time)+T0).^4,0,2)*sigma*60 qExact = 4.1299e+04 qQuartic=integral(@(time) (polyval(CoefQuartFit,time))+T0).^4,0,2)*sigma*60 qQuartic=integral(@(time) (polyval(CoefQuartFit,time))+T0).^4,0,2)*sigma*60  {Error: Unbalanced or unexpected parenthesis or bracket. } qQuartic=integral(@(time) (polyval(CoefQuartFit,time)+T0).^4,0,2)*sigma*60 {Undefined function or variable 'CoefQuartFit'. Error in @(time)(polyval(CoefQuartFit,time)+T0).^4 Error in integralCalc/iterateScalarValued (line 314) fx = FUN(t); Error in integralCalc/vadapt (line 132) [q,errbnd] = iterateScalarValued(u,tinterval,pathlen); Error in integralCalc (line 75) [q,errbnd] = vadapt(@AtoBInvTransform,interval); Error in integral (line 88) Q = integralCalc(fun,a,b,opstruct);} qExact=integral(@(time) (polyval(CoefQuarticFit,time)+T0).^4,0,2)*sigma*60 qExact = 4.1290e+04 qQuartic=integral(@(time) (polyval(CoefQuarticFit,time)+T0).^4,0,2)*sigma*60 qQuartic = 4.1290e+04 qExact=integral(@(time) (TempExactFun(time)+T0).^4,0,2)*sigma*60 qExact = 4.1299e+04