Matrix Operations and Data Writing in Excel Using MATLAB

School
Tennessee Temple University**We aren't endorsed by this school
Course
ACCT 3596
Subject
Electrical Engineering
Date
Dec 9, 2024
Pages
2
Uploaded by magai89
ISA:E SR s i flag=n1+2; str=char(['A', int2str(flag)]); %str i Excel P EHIEKEIRIE xIswrite('bk. xIs',dcoef1','sSheet1', str) [vec2,val2]=eig(m2); fori=1.n2 vec2(.,i) =vec2(;,i)/sqrt(vec2(;,i)' * s2 x vec2(.,1)); RIFEMEIT—1k, b's2b=1 vec2(;,i) =vec2(;,i)/sign(sum(vec2(.,i))); RAFEEBEFLL 1 3 1, /FiIERH S EFAIE end val2 = sgrt(diag(val2)); % i B AR IEE R R [val2,ind2] = sort(val2,'descend'); %3&HE MBI/ EFI b=vec2(:,ind2(1:num)) BEXH VY 4HH R EEE dcoef2=val2(1.,num) %R HHEHLEE flag = flag+2; str=char(['A',int2str(flag)]); %str k Excel FE¥EMEBVE xlswrite('bk. x1s', b, 'Sheet1', str) flag = flag+n2 + 1; str=char(['A', int2str(flag)]); %str 3k Excel §5¥EMELS (A , xIswrite('bk. xIs',dcoef2','Sheet1', str) X ur=sixa %x,u BRI yVvVr=s2xb %y,v BIHXRE X Vr=s12xb %%,V HIFHX R y ur=s2ixa %y, u I R E flag = flag +2; str=char(['A', int2str(flag)]); xIswrite('bk.xIs',x_u_r,'Sheet1',str) flag = flag+n1+ 1; str=char(['A', int2str(flag) ]); xlswrite('bk.xls',y v_r,'Sheet1',str) flag = flag + n2+ 1; str=char(['A', int2str(flag) ]); xlswrite('bk.xIs',x_v_r,'Sheet1',str) flag = flag + n1+ 1; str=char(['A!, int2str(flag) ]); xlswrite('bk.xlIs',y u_r,'Sheet1',str) mu=sum(x_u r.~2)/n1 %x HRIHETEH u i BRI ZHE mv=sum(x_v_r."2)/n1 %x H R R v_i BRI Z B nu=sum(y_u r.”2)/n2 %y AR R u i BRI ZE G nv=sum(y_v_r.~2)/n2 %y @RI R v_i BB E fprintf('X 20 i JRIR A B o u1~u2%d B L) R % F\n', num, sum(mu) ) ; fprintf('Y HH RIS B #E v1~vo4d R L2 % f\n',num, sum(nv)) ; BITERIMT
Background image
0.4217 0. 1951 0.1676 —0.0229 0.4597 dcoef1 = 0.5537 0.2364 0.1192 0.0722 0.0573 0.4252 0.2089 —0.0359 0.0235 0.2903 0.5157 —0.1101 dcoef2 = 0.5537 0.2364 0.1192 0.0722 0.0573 0.8293 0.7304 0.7533 0.6160 0.8606 =0 —0. ~0. =0 —0s -0. —10s =0. ~ 0. =10 =0- 3429 . 6683 .8532 3561 7287 0880 . 4363 0929 .9260 1011 5543 0317 1093 . 4366 . 4661 2225 2660 =04 0 —0. -o. .8577 . 4434 .2592 L4231 .9799 .4918 7832 4778 0065 .2831 4125 .9285 . 4853 .2001 . 1056 .2053 . 3886 —0.7884 —0.2691 0.4688 1.0423 —0. 1682 0.1284 0.3405 0.6059 —0.4044 0.4469 —0.6876 —0.2739 —0.2469 0.0021 0.3020 0.6614 0. 1484 12 REMEXNMN 0.0308 0.9832 —0.9141 0.5244 —0.4392 —0.4823 —0.7499 0.3457 "0.3116 0.7030 0.1796 —0.0145 0.0611 0.4857 —0.3360 0.3026 —0.1246
Background image