Skip to content

klb16105/ME3255-Extra_Credit

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 

ME3255-Extra_Credit

Electricity Usage

Task 1✘

load(electricity.mat) Undefined variable "electricity" or class "electricity.mat". Task 1✘ load(electricity load) Error: Unexpected MATLAB expression. Task 1✘ load(electricity) Undefined function or variable 'electricity'. Task 1 load electricity Task 2 usage

usage =

3.0484    2.5848    2.6408
2.8610    2.5530       NaN
3.2602    2.7084    2.7345
3.3420    2.8097    2.8019
3.3555    2.9167    2.7960
3.4234    2.9299    2.8579
3.5268    3.1561    2.8597
3.9185    3.3057    2.8757
3.9718    3.4761    2.9984
3.8540    3.4748    2.8998
3.8934    3.5968    2.6826
4.3127    3.7088    2.8427
4.2153    3.7172    2.8301
4.1711    3.7257    2.8542
4.6605    3.9367    2.8512
4.7528    4.0497    2.8671
4.4847    3.9975    2.8715
4.6216    4.1299    2.8487
4.4413    3.9229    2.5176
4.9899    4.1266    2.7653
4.9913    4.1311    2.8143
4.9864    4.1463    2.8135
4.6270    4.1205    2.7001

Task 3✘

A(i,j) = 2.74 Subscript indices must either be real positive integers or logicals. Task 3 usage(2,3) = 2.74

usage =

3.0484    2.5848    2.6408
2.8610    2.5530    2.7400
3.2602    2.7084    2.7345
3.3420    2.8097    2.8019
3.3555    2.9167    2.7960
3.4234    2.9299    2.8579
3.5268    3.1561    2.8597
3.9185    3.3057    2.8757
3.9718    3.4761    2.9984
3.8540    3.4748    2.8998
3.8934    3.5968    2.6826
4.3127    3.7088    2.8427
4.2153    3.7172    2.8301
4.1711    3.7257    2.8542
4.6605    3.9367    2.8512
4.7528    4.0497    2.8671
4.4847    3.9975    2.8715
4.6216    4.1299    2.8487
4.4413    3.9229    2.5176
4.9899    4.1266    2.7653
4.9913    4.1311    2.8143
4.9864    4.1463    2.8135
4.6270    4.1205    2.7001

Task 4

res=usage(:,1)

res =

3.0484
2.8610
3.2602
3.3420
3.3555
3.4234
3.5268
3.9185
3.9718
3.8540
3.8934
4.3127
4.2153
4.1711
4.6605
4.7528
4.4847
4.6216
4.4413
4.9899
4.9913
4.9864
4.6270

Task 5

comm=usage(:,2)

comm =

2.5848
2.5530
2.7084
2.8097
2.9167
2.9299
3.1561
3.3057
3.4761
3.4748
3.5968
3.7088
3.7172
3.7257
3.9367
4.0497
3.9975
4.1299
3.9229
4.1266
4.1311
4.1463
4.1205

Task 6

ind=usage(:,3)

ind =

2.6408
2.7400
2.7345
2.8019
2.7960
2.8579
2.8597
2.8757
2.9984
2.8998
2.6826
2.8427
2.8301
2.8542
2.8512
2.8671
2.8715
2.8487
2.5176
2.7653
2.8143
2.8135
2.7001

Task 7

yrs = (1991:2013)'

yrs =

    1991
    1992
    1993
    1994
    1995
    1996
    1997
    1998
    1999
    2000
    2001
    2002
    2003
    2004
    2005
    2006
    2007
    2008
    2009
    2010
    2011
    2012
    2013

Task 8

plot(yrs,res,'b--') Task 9 hold on Task 10 plot(yrs,comm,'k:') Task 11✘ plot(yrs,ind,'m-') Task 11 plot(yrs,ind,'m-.') Task 12 title('July Electricity Usage') Task 13 legend('res','comm','ind')

load(electricity.mat) Undefined variable "electricity" or class "electricity.mat". Task 1✘ load(electricity load) Error: Unexpected MATLAB expression. Task 1✘ load(electricity) Undefined function or variable 'electricity'. Task 1 load electricity Task 2 usage

usage =

3.0484    2.5848    2.6408
2.8610    2.5530       NaN
3.2602    2.7084    2.7345
3.3420    2.8097    2.8019
3.3555    2.9167    2.7960
3.4234    2.9299    2.8579
3.5268    3.1561    2.8597
3.9185    3.3057    2.8757
3.9718    3.4761    2.9984
3.8540    3.4748    2.8998
3.8934    3.5968    2.6826
4.3127    3.7088    2.8427
4.2153    3.7172    2.8301
4.1711    3.7257    2.8542
4.6605    3.9367    2.8512
4.7528    4.0497    2.8671
4.4847    3.9975    2.8715
4.6216    4.1299    2.8487
4.4413    3.9229    2.5176
4.9899    4.1266    2.7653
4.9913    4.1311    2.8143
4.9864    4.1463    2.8135
4.6270    4.1205    2.7001

Task 3✘

A(i,j) = 2.74 Subscript indices must either be real positive integers or logicals. Task 3 usage(2,3) = 2.74

usage =

3.0484    2.5848    2.6408
2.8610    2.5530    2.7400
3.2602    2.7084    2.7345
3.3420    2.8097    2.8019
3.3555    2.9167    2.7960
3.4234    2.9299    2.8579
3.5268    3.1561    2.8597
3.9185    3.3057    2.8757
3.9718    3.4761    2.9984
3.8540    3.4748    2.8998
3.8934    3.5968    2.6826
4.3127    3.7088    2.8427
4.2153    3.7172    2.8301
4.1711    3.7257    2.8542
4.6605    3.9367    2.8512
4.7528    4.0497    2.8671
4.4847    3.9975    2.8715
4.6216    4.1299    2.8487
4.4413    3.9229    2.5176
4.9899    4.1266    2.7653
4.9913    4.1311    2.8143
4.9864    4.1463    2.8135
4.6270    4.1205    2.7001

Task 4

res=usage(:,1)

res =

3.0484
2.8610
3.2602
3.3420
3.3555
3.4234
3.5268
3.9185
3.9718
3.8540
3.8934
4.3127
4.2153
4.1711
4.6605
4.7528
4.4847
4.6216
4.4413
4.9899
4.9913
4.9864
4.6270

Task 5

comm=usage(:,2)

comm =

2.5848
2.5530
2.7084
2.8097
2.9167
2.9299
3.1561
3.3057
3.4761
3.4748
3.5968
3.7088
3.7172
3.7257
3.9367
4.0497
3.9975
4.1299
3.9229
4.1266
4.1311
4.1463
4.1205

Task 6

ind=usage(:,3)

ind =

2.6408
2.7400
2.7345
2.8019
2.7960
2.8579
2.8597
2.8757
2.9984
2.8998
2.6826
2.8427
2.8301
2.8542
2.8512
2.8671
2.8715
2.8487
2.5176
2.7653
2.8143
2.8135
2.7001

Task 7

yrs = (1991:2013)'

yrs =

    1991
    1992
    1993
    1994
    1995
    1996
    1997
    1998
    1999
    2000
    2001
    2002
    2003
    2004
    2005
    2006
    2007
    2008
    2009
    2010
    2011
    2012
    2013

Task 8

plot(yrs,res,'b--') Task 9 hold on Task 10 plot(yrs,comm,'k:') Task 11✘ plot(yrs,ind,'m-') Task 11 plot(yrs,ind,'m-.') Task 12 title('July Electricity Usage') Task 13 legend('res','comm','ind')

#Audio Frequency Task 1

fs = 10; Task 2✘ t = 5:1/fs:15; Task 2 t = 0:1/fs:20; Task 3✘ y = sin(1.82pit) + sin(2pix) Undefined function or variable 'x'. Task 3✘ y = sin(1.82pit) + sin(2pit)

y =

Columns 1 through 18

     0    1.4926    1.7216    0.7024   -0.3945   -0.5878   -0.1060    0.0470   -0.5829   -1.2723   -0.9511    0.4625    1.7954    1.7954    0.4625   -0.9511   -1.2723   -0.5829

Columns 19 through 36

0.0470   -0.1060   -0.5878   -0.3945    0.7024    1.7216    1.4926    0.0000   -1.4926   -1.7216   -0.7024    0.3945    0.5878    0.1060   -0.0470    0.5829    1.2723    0.9511

Columns 37 through 54

-0.4625 -1.7954 -1.7954 -0.4625 0.9511 1.2723 0.5829 -0.0470 0.1060 0.5878 0.3945 -0.7024 -1.7216 -1.4926 -0.0000 1.4926 1.7216 0.7024

Columns 55 through 72

-0.3945 -0.5878 -0.1060 0.0470 -0.5829 -1.2723 -0.9511 0.4625 1.7954 1.7954 0.4625 -0.9511 -1.2723 -0.5829 0.0470 -0.1060 -0.5878 -0.3945

Columns 73 through 90

0.7024    1.7216    1.4926    0.0000   -1.4926   -1.7216   -0.7024    0.3945    0.5878    0.1060   -0.0470    0.5829    1.2723    0.9511   -0.4625   -1.7954   -1.7954   -0.4625

Columns 91 through 108

0.9511    1.2723    0.5829   -0.0470    0.1060    0.5878    0.3945   -0.7024   -1.7216   -1.4926   -0.0000    1.4926    1.7216    0.7024   -0.3945   -0.5878   -0.1060    0.0470

Columns 109 through 126

-0.5829 -1.2723 -0.9511 0.4625 1.7954 1.7954 0.4625 -0.9511 -1.2723 -0.5829 0.0470 -0.1060 -0.5878 -0.3945 0.7024 1.7216 1.4926 0.0000

Columns 127 through 144

-1.4926 -1.7216 -0.7024 0.3945 0.5878 0.1060 -0.0470 0.5829 1.2723 0.9511 -0.4625 -1.7954 -1.7954 -0.4625 0.9511 1.2723 0.5829 -0.0470

Columns 145 through 162

0.1060    0.5878    0.3945   -0.7024   -1.7216   -1.4926   -0.0000    1.4926    1.7216    0.7024   -0.3945   -0.5878   -0.1060    0.0470   -0.5829   -1.2723   -0.9511    0.4625

Columns 163 through 180

1.7954    1.7954    0.4625   -0.9511   -1.2723   -0.5829    0.0470   -0.1060   -0.5878   -0.3945    0.7024    1.7216    1.4926    0.0000   -1.4926   -1.7216   -0.7024    0.3945

Columns 181 through 198

0.5878    0.1060   -0.0470    0.5829    1.2723    0.9511   -0.4625   -1.7954   -1.7954   -0.4625    0.9511    1.2723    0.5829   -0.0470    0.1060    0.5878    0.3945   -0.7024

Columns 199 through 201

-1.7216 -1.4926 -0.0000

Task 3

y = sin(1.82pit) + sin(2.12pit)

y =

Columns 1 through 18

     0    1.8734    1.2523   -0.9777   -1.8266   -0.2788    1.4798    1.1854   -0.5367   -1.3220   -0.3633    0.8044    0.7190   -0.1478   -0.4935   -0.1420    0.0860   -0.0577

Columns 19 through 36

0.0157    0.4190    0.3633   -0.4465   -0.9332   -0.1058    1.1535    1.0000   -0.6561   -1.6468   -0.4359    1.5181    1.5388   -0.5445   -1.9803   -0.7939    1.4551    1.7601

Columns 37 through 54

-0.2428 -1.8364 -0.9697 1.0551 1.5388 0.0471 -1.2730 -0.8106 0.5163 0.8968 0.1380 -0.4803 -0.2888 0.0638 -0.0000 -0.0638 0.2888 0.4803

Columns 55 through 72

-0.1380 -0.8968 -0.5163 0.8106 1.2730 -0.0471 -1.5388 -1.0551 0.9697 1.8364 0.2428 -1.7601 -1.4551 0.7939 1.9803 0.5445 -1.5388 -1.5181

Columns 73 through 90

0.4359    1.6468    0.6561   -1.0000   -1.1535    0.1058    0.9332    0.4465   -0.3633   -0.4190   -0.0157    0.0577   -0.0860    0.1420    0.4935    0.1478   -0.7190   -0.8044

Columns 91 through 108

0.3633    1.3220    0.5367   -1.1854   -1.4798    0.2788    1.8266    0.9777   -1.2523   -1.8734   -0.0000    1.8734    1.2523   -0.9777   -1.8266   -0.2788    1.4798    1.1854

Columns 109 through 126

-0.5367 -1.3220 -0.3633 0.8044 0.7190 -0.1478 -0.4935 -0.1420 0.0860 -0.0577 0.0157 0.4190 0.3633 -0.4465 -0.9332 -0.1058 1.1535 1.0000

Columns 127 through 144

-0.6561 -1.6468 -0.4359 1.5181 1.5388 -0.5445 -1.9803 -0.7939 1.4551 1.7601 -0.2428 -1.8364 -0.9697 1.0551 1.5388 0.0471 -1.2730 -0.8106

Columns 145 through 162

0.5163    0.8968    0.1380   -0.4803   -0.2888    0.0638   -0.0000   -0.0638    0.2888    0.4803   -0.1380   -0.8968   -0.5163    0.8106    1.2730   -0.0471   -1.5388   -1.0551

Columns 163 through 180

0.9697    1.8364    0.2428   -1.7601   -1.4551    0.7939    1.9803    0.5445   -1.5388   -1.5181    0.4359    1.6468    0.6561   -1.0000   -1.1535    0.1058    0.9332    0.4465

Columns 181 through 198

-0.3633 -0.4190 -0.0157 0.0577 -0.0860 0.1420 0.4935 0.1478 -0.7190 -0.8044 0.3633 1.3220 0.5367 -1.1854 -1.4798 0.2788 1.8266 0.9777

Columns 199 through 201

-1.2523 -1.8734 -0.0000

Task 4

plot(t,y) Task 5 yfft = fft(y)

yfft =

Columns 1 through 9

0.0000 + 0.0000i 0.0007 - 0.0448i 0.0028 - 0.0898i 0.0063 - 0.1351i 0.0113 - 0.1808i 0.0178 - 0.2273i 0.0258 - 0.2746i 0.0355 - 0.3230i 0.0468 - 0.3726i

Columns 10 through 18

0.0600 - 0.4237i 0.0751 - 0.4765i 0.0923 - 0.5314i 0.1117 - 0.5887i 0.1336 - 0.6487i 0.1583 - 0.7118i 0.1860 - 0.7786i 0.2170 - 0.8496i 0.2519 - 0.9255i

Columns 19 through 27

0.2911 - 1.0072i 0.3352 - 1.0955i 0.3852 - 1.1918i 0.4418 - 1.2975i 0.5065 - 1.4144i 0.5807 - 1.5451i 0.6665 - 1.6927i 0.7667 - 1.8613i 0.8851 - 2.0567i

Columns 28 through 36

1.0268 - 2.2869i 1.1995 - 2.5636i 1.4148 - 2.9047i 1.6914 - 3.3389i 2.0612 - 3.9159i 2.5857 - 4.7313i 3.3998 - 5.9964i 4.8791 - 8.3004i 8.6481 -14.1995i

Columns 37 through 45

52.1546 -82.6959i -9.7052 +14.8683i -3.0073 + 4.4535i -0.3326 + 0.4764i 2.2099 - 3.0617i 7.1986 - 9.6519i 54.8155 -71.1486i -17.3938 +21.8612i -8.7273 +10.6237i

Columns 46 through 54

-6.1917 + 7.3014i -4.9529 + 5.6589i -4.2083 + 4.6591i -3.7068 + 3.9772i -3.3442 + 3.4775i -3.0688 + 3.0929i -2.8520 + 2.7860i -2.6768 + 2.5342i -2.5321 + 2.3232i

Columns 55 through 63

-2.4105 + 2.1433i -2.3069 + 1.9875i -2.2176 + 1.8510i -2.1399 + 1.7301i -2.0717 + 1.6220i -2.0113 + 1.5247i -1.9576 + 1.4364i -1.9096 + 1.3557i -1.8663 + 1.2816i

Columns 64 through 72

-1.8273 + 1.2132i -1.7919 + 1.1498i -1.7597 + 1.0907i -1.7302 + 1.0353i -1.7033 + 0.9834i -1.6786 + 0.9345i -1.6559 + 0.8882i -1.6349 + 0.8443i -1.6156 + 0.8026i

Columns 73 through 81

-1.5978 + 0.7629i -1.5812 + 0.7248i -1.5659 + 0.6884i -1.5517 + 0.6534i -1.5386 + 0.6198i -1.5264 + 0.5873i -1.5151 + 0.5559i -1.5045 + 0.5255i -1.4948 + 0.4960i

Columns 82 through 90

-1.4858 + 0.4674i -1.4774 + 0.4395i -1.4696 + 0.4123i -1.4625 + 0.3858i -1.4559 + 0.3598i -1.4498 + 0.3343i -1.4443 + 0.3093i -1.4392 + 0.2848i -1.4346 + 0.2607i

Columns 91 through 99

-1.4304 + 0.2369i -1.4267 + 0.2134i -1.4233 + 0.1902i -1.4204 + 0.1673i -1.4178 + 0.1445i -1.4157 + 0.1220i -1.4139 + 0.0996i -1.4125 + 0.0773i -1.4114 + 0.0552i

Columns 100 through 108

-1.4107 + 0.0331i -1.4103 + 0.0110i -1.4103 - 0.0110i -1.4107 - 0.0331i -1.4114 - 0.0552i -1.4125 - 0.0773i -1.4139 - 0.0996i -1.4157 - 0.1220i -1.4178 - 0.1445i

Columns 109 through 117

-1.4204 - 0.1673i -1.4233 - 0.1902i -1.4267 - 0.2134i -1.4304 - 0.2369i -1.4346 - 0.2607i -1.4392 - 0.2848i -1.4443 - 0.3093i -1.4498 - 0.3343i -1.4559 - 0.3598i

Columns 118 through 126

-1.4625 - 0.3858i -1.4696 - 0.4123i -1.4774 - 0.4395i -1.4858 - 0.4674i -1.4948 - 0.4960i -1.5045 - 0.5255i -1.5151 - 0.5559i -1.5264 - 0.5873i -1.5386 - 0.6198i

Columns 127 through 135

-1.5517 - 0.6534i -1.5659 - 0.6884i -1.5812 - 0.7248i -1.5978 - 0.7629i -1.6156 - 0.8026i -1.6349 - 0.8443i -1.6559 - 0.8882i -1.6786 - 0.9345i -1.7033 - 0.9834i

Columns 136 through 144

-1.7302 - 1.0353i -1.7597 - 1.0907i -1.7919 - 1.1498i -1.8273 - 1.2132i -1.8663 - 1.2816i -1.9096 - 1.3557i -1.9576 - 1.4364i -2.0113 - 1.5247i -2.0717 - 1.6220i

Columns 145 through 153

-2.1399 - 1.7301i -2.2176 - 1.8510i -2.3069 - 1.9875i -2.4105 - 2.1433i -2.5321 - 2.3232i -2.6768 - 2.5342i -2.8520 - 2.7860i -3.0688 - 3.0929i -3.3442 - 3.4775i

Columns 154 through 162

-3.7068 - 3.9772i -4.2083 - 4.6591i -4.9529 - 5.6589i -6.1917 - 7.3014i -8.7273 -10.6237i -17.3938 -21.8612i 54.8155 +71.1486i 7.1986 + 9.6519i 2.2099 + 3.0617i

Columns 163 through 171

-0.3326 - 0.4764i -3.0073 - 4.4535i -9.7052 -14.8683i 52.1546 +82.6959i 8.6481 +14.1995i 4.8791 + 8.3004i 3.3998 + 5.9964i 2.5857 + 4.7313i 2.0612 + 3.9159i

Columns 172 through 180

1.6914 + 3.3389i 1.4148 + 2.9047i 1.1995 + 2.5636i 1.0268 + 2.2869i 0.8851 + 2.0567i 0.7667 + 1.8613i 0.6665 + 1.6927i 0.5807 + 1.5451i 0.5065 + 1.4144i

Columns 181 through 189

0.4418 + 1.2975i 0.3852 + 1.1918i 0.3352 + 1.0955i 0.2911 + 1.0072i 0.2519 + 0.9255i 0.2170 + 0.8496i 0.1860 + 0.7786i 0.1583 + 0.7118i 0.1336 + 0.6487i

Columns 190 through 198

0.1117 + 0.5887i 0.0923 + 0.5314i 0.0751 + 0.4765i 0.0600 + 0.4237i 0.0468 + 0.3726i 0.0355 + 0.3230i 0.0258 + 0.2746i 0.0178 + 0.2273i 0.0113 + 0.1808i

Columns 199 through 201

0.0063 + 0.1351i 0.0028 + 0.0898i 0.0007 + 0.0448i

Task 6

n = numel(y)

n =

201

Task 7

f = 0:fs/n:fs*(n-1)/n; Task 8 plot(f,abs(yfft))

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published