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